Skip to content

Conversation

@ivandika3
Copy link
Contributor

What changes were proposed in this pull request?

See BlockDataStreamOutput#needSync, currently SYNC is never used and therefore we might not be sure when the data is actually flushed to the disk (see StreamDataChannelBase#force which will invoke FileChannel#force(false) to flush the data to the underlying storage)

private boolean needSync(long position) {
  if (SYNC_SIZE > 0) {
    // TODO: or position >= fileLength
    if (position - syncPosition >= SYNC_SIZE) {
      syncPosition = position;
      return true;
    }
  }
  return false;
} 

We can create a configuration to allow SYNC, which is disabled by default to preserve compatibility.

We also might want to revisit whether we should make SYNC to be a client-side or server-side. The concern is if a client is misconfigured, it might cause a lot of sync on the DN which will cause higher latencies.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-14194

How was this patch tested?

@rich7420
Copy link
Contributor

thanks for the patch @ivandika3 !

@ivandika3 ivandika3 self-assigned this Dec 21, 2025
@adoroszlai adoroszlai requested a review from szetszwo December 22, 2025 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants