HDFS-16507. [SBN read] Avoid purging edit log which is in progress (#4082)

This commit is contained in:
litao 2022-03-31 14:01:48 +08:00 committed by GitHub
parent 2bf78e2416
commit 9a4dddd640
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 5 deletions

View File

@ -1516,10 +1516,11 @@ public class FSEditLog implements LogsPurgeable {
return; return;
} }
assert curSegmentTxId == HdfsServerConstants.INVALID_TXID || // on format this is no-op Preconditions.checkArgument(
minTxIdToKeep <= curSegmentTxId : curSegmentTxId == HdfsServerConstants.INVALID_TXID || // on format this is no-op
"cannot purge logs older than txid " + minTxIdToKeep + minTxIdToKeep <= curSegmentTxId,
" when current segment starts at " + curSegmentTxId; "cannot purge logs older than txid " + minTxIdToKeep +
" when current segment starts at " + curSegmentTxId);
if (minTxIdToKeep == 0) { if (minTxIdToKeep == 0) {
return; return;
} }