HDFS-16507. [SBN read] Avoid purging edit log which is in progress (#4082)
This commit is contained in:
parent
e24bd1c15b
commit
cfca024190
|
@ -1512,11 +1512,12 @@ public class FSEditLog implements LogsPurgeable {
|
||||||
if (!isOpenForWrite()) {
|
if (!isOpenForWrite()) {
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue