Fix synchronization in LocalCheckpointTracker#contains (#38755)

We are accessing the `CountedBitSet` in `LocalCheckpointTracker#contains`
without proper synchronization.

Relates #33871
This commit is contained in:
Nhat Nguyen 2019-02-12 11:06:22 -05:00
parent 225ebb6935
commit eca5404572
1 changed files with 3 additions and 3 deletions

View File

@ -157,11 +157,11 @@ public class LocalCheckpointTracker {
return true;
}
final long bitSetKey = getBitSetKey(seqNo);
final CountedBitSet bitSet;
final int bitSetOffset = seqNoToBitSetOffset(seqNo);
synchronized (this) {
bitSet = processedSeqNo.get(bitSetKey);
final CountedBitSet bitSet = processedSeqNo.get(bitSetKey);
return bitSet != null && bitSet.get(bitSetOffset);
}
return bitSet != null && bitSet.get(seqNoToBitSetOffset(seqNo));
}
/**