|
@@ -126,6 +126,7 @@ class BlockReceiver implements Closeable {
|
|
|
|
|
|
private boolean syncOnClose;
|
|
|
private volatile boolean dirSyncOnFinalize;
|
|
|
+ private boolean dirSyncOnHSyncDone = false;
|
|
|
private long restartBudget;
|
|
|
/** the reference of the volume where the block receiver writes to */
|
|
|
private ReplicaHandler replicaHandler;
|
|
@@ -424,6 +425,10 @@ class BlockReceiver implements Closeable {
|
|
|
}
|
|
|
flushTotalNanos += flushEndNanos - flushStartNanos;
|
|
|
}
|
|
|
+ if (isSync && !dirSyncOnHSyncDone && replicaInfo instanceof LocalReplica) {
|
|
|
+ ((LocalReplica) replicaInfo).fsyncDirectory();
|
|
|
+ dirSyncOnHSyncDone = true;
|
|
|
+ }
|
|
|
if (checksumOut != null || streams.getDataOut() != null) {
|
|
|
datanode.metrics.addFlushNanos(flushTotalNanos);
|
|
|
if (isSync) {
|