HDFS-16618. sync_file_range error should include more volume/file info (#4402)

Signed-off-by: Tao Li <tomscut@apache.org>
This commit is contained in:
Viraj Jasani 2022-06-07 01:53:45 -07:00 committed by tom lee
parent 4ebdc38634
commit 557ab95dc2
1 changed files with 13 additions and 9 deletions

View File

@ -216,16 +216,20 @@ class FsDatasetAsyncDiskService {
} }
} }
public void submitSyncFileRangeRequest(FsVolumeImpl volume, public void submitSyncFileRangeRequest(FsVolumeImpl volume, final ReplicaOutputStreams streams,
final ReplicaOutputStreams streams, final long offset, final long nbytes, final long offset, final long nbytes, final int flags) {
final int flags) { execute(volume, () -> {
execute(volume, new Runnable() {
@Override
public void run() {
try { try {
streams.syncFileRangeIfPossible(offset, nbytes, flags); streams.syncFileRangeIfPossible(offset, nbytes, flags);
} catch (NativeIOException e) { } catch (NativeIOException e) {
LOG.warn("sync_file_range error", e); try {
LOG.warn("sync_file_range error. Volume: {}, Capacity: {}, Available space: {}, "
+ "File range offset: {}, length: {}, flags: {}", volume, volume.getCapacity(),
volume.getAvailable(), offset, nbytes, flags, e);
} catch (IOException ioe) {
LOG.warn("sync_file_range error. Volume: {}, Capacity: {}, "
+ "File range offset: {}, length: {}, flags: {}", volume, volume.getCapacity(),
offset, nbytes, flags, e);
} }
} }
}); });