PHOENIX-7860 Fix cell serialization and deserialization when CP cells are merged#2483
PHOENIX-7860 Fix cell serialization and deserialization when CP cells are merged#2483tkhurana wants to merge 1 commit into
Conversation
…s from mutations from CP are merged
|
@tkhurana Did you include other changes here by accident ? There are some changes to how Some unrelated cleanups in |
@apurtell It is a test bug which surfaced when you spin multiple RS in the same JVM. I didn't file a separate PR for it. |
|
It should probably be its own PR or else it's a hidden change, effectively. |
apurtell
left a comment
There was a problem hiding this comment.
The changes related to how ReplicationLogGroups are keyed should be in their own PR.
There are some unrelated cleanups in IndexRegionObserver also but not consequential.
I'm approving this because the changes to cell ser-de look good to me and can be merged.
Summary
When a coprocessor adds cells to a mutation (local index, conditional TTL, ON DUPLICATE KEY UPDATE), HBase's
checkAndMergeCPMutationsmerges those cells into the data mutation. The resulting mutation can mix row keys and cell types (e.g., aPutcontainingDeleteColumn/DeleteFamilycells, or cells with different row keys for local indexes). Replication previously appended the merged mutation as-is and the codec relied on the mutation type to drive cell-level deserialization, which round-tripped incorrectly and lost cell-type fidelity.This change:
IndexRegionObserver:Put/Deletemutations grouped by(row key, put-vs-delete)before appending to the replication log, using the same algorithm as HBase'sReplicationSink.replicateEditOnWALRestoreto use the same splitter rather than its own row-grouping loop.LogFileCodec:KeyValueon decode, preservingDeleteColumn/DeleteFamily/DeleteFamilyVersiondistinctions.LogFileRecord:MutationTypevariants for delete subtypes; aDeleteis justDELETEbecause cell types are encoded per-cell.ReplicationLogGroup:INSTANCEScache byserverName + haGroupNameso multiple region servers sharing a JVM (mini-cluster) don't collide.LogFileCodecTest: covers mixed cell types within oneDelete, and round-trip for all 5 cell type bytes (Put,Delete,DeleteColumn,DeleteFamily,DeleteFamilyVersion).ReplicationLogGroupIT: replays log files on cluster 2 and asserts cross-cluster cell-level equality for the indexed-table, multi-CF, ON DUPLICATE KEY UPDATE, and conditional-TTL paths.LogFileFormatTest: relaxes a brittle exception-message assertion.Test plan
mvn test -pl phoenix-core -Dtest=LogFileCodecTestmvn test -pl phoenix-core -Dtest=LogFileFormatTestmvn verify -pl phoenix-core -Dit.test=ReplicationLogGroupITmvn spotless:check