HBASE-22681 The 'assert highestUnsyncedTxid < entry.getTxid();' in AbstractFWAL.append may fail when using AsyncFSWAL (#376)
Signed-off-by: Zheng Hu <openinx@gmail.com>
This commit is contained in:
parent
30e874ae58
commit
421ae2a688
|
@ -437,7 +437,11 @@ public class AsyncFSWAL extends AbstractFSWAL<AsyncWriter> {
|
||||||
newHighestProcessedAppendTxid = entry.getTxid();
|
newHighestProcessedAppendTxid = entry.getTxid();
|
||||||
iter.remove();
|
iter.remove();
|
||||||
if (appended) {
|
if (appended) {
|
||||||
unackedAppends.addLast(entry);
|
// This is possible, when we fail to sync, we will add the unackedAppends back to
|
||||||
|
// toWriteAppends, so here we may get an entry which is already in the unackedAppends.
|
||||||
|
if (unackedAppends.isEmpty() || unackedAppends.peekLast().getTxid() < entry.getTxid()) {
|
||||||
|
unackedAppends.addLast(entry);
|
||||||
|
}
|
||||||
if (writer.getLength() - fileLengthAtLastSync >= batchSize) {
|
if (writer.getLength() - fileLengthAtLastSync >= batchSize) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue