Bug: Assertion failure in NewVersionBehaviorTracker during major compaction
Status: Open | Priority: Major | Resolution: 
Created: 16/Mar/24 02:45

The attached test inserts put, and delete mutations that include all
types of delete markers. These mutations are written to multiple files using multiple memstore flushes. Then the test runs minor compaction, and finally major compaction. When KeepDeleteCells is set to true and new version behavior is enabled, the test fails with the following assertion failure:
{code:java}
java.lang.AssertionError
    at org.apache.hadoop.hbase.regionserver.querymatcher.NewVersionBehaviorTracker.checkVersions(NewVersionBehaviorTracker.java:310)
    at org.apache.hadoop.hbase.regionserver.querymatcher.MajorCompactionScanQueryMatcher.match(MajorCompactionScanQueryMatcher.java:78)
    at org.apache.hadoop.hbase.regionserver.StoreScanner.next(StoreScanner.java:640)
    at org.apache.hadoop.hbase.regionserver.compactions.Compactor.performCompaction(Compactor.java:446)
    at org.apache.hadoop.hbase.regionserver.compactions.Compactor.compact(Compactor.java:367)
    at org.apache.hadoop.hbase.regionserver.compactions.DefaultCompactor.compact(DefaultCompactor.java:62)
    at org.apache.hadoop.hbase.regionserver.DefaultStoreEngine$DefaultCompactionContext.compact(DefaultStoreEngine.java:122)
    at org.apache.hadoop.hbase.regionserver.HStore.compact(HStore.java:1177)
    at org.apache.hadoop.hbase.regionserver.HRegion.compact(HRegion.java:2407)
    at org.apache.hadoop.hbase.regionserver.HRegion.compact(HRegion.java:2262)
    at org.apache.hadoop.hbase.regionserver.TestStoreFileWriter.testCompactedFiles(TestStoreFileWriter.java:187)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
    at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
    at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
    at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
    at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
    at org.junit.runners.Suite.runChild(Suite.java:128)
    at org.junit.runners.Suite.runChild(Suite.java:27)
    at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
    at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
    at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:299)
    at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:293)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.lang.Thread.run(Thread.java:748) {code}
The attached [^Test-for-the-assert-failure-in-NewVersionBehaviorTra.patch]test is a simplified version of the test in the PR for HBASE-25972.