tkhurana opened a new pull request, #2483:
URL: https://github.com/apache/phoenix/pull/2483

   ## Summary
   
   When a coprocessor adds cells to a mutation (local index, conditional TTL, 
ON DUPLICATE KEY UPDATE), HBase's `checkAndMergeCPMutations` merges those cells 
into the data mutation. The resulting mutation can mix row keys and cell types 
(e.g., a `Put` containing `DeleteColumn`/`DeleteFamily` cells, 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`**:
     - Splits a merged mutation back into individual `Put`/`Delete` mutations 
grouped by `(row key, put-vs-delete)` before appending to the replication log, 
using the same algorithm as HBase's `ReplicationSink`.
     - Refactors `replicateEditOnWALRestore` to use the same splitter rather 
than its own row-grouping loop.
   - **`LogFileCodec`**:
     - Persists the per-cell type byte and reconstructs cells via `KeyValue` on 
decode, preserving `DeleteColumn`/`DeleteFamily`/`DeleteFamilyVersion` 
distinctions.
   - **`LogFileRecord`**:
     - Removes the now-redundant `MutationType` variants for delete subtypes; a 
`Delete` is just `DELETE` because cell types are encoded per-cell.
   - **`ReplicationLogGroup`**:
     - Keys the `INSTANCES` cache by `serverName + haGroupName` so multiple 
region servers sharing a JVM (mini-cluster) don't collide.
   - **Tests**:
     - `LogFileCodecTest`: covers mixed cell types within one `Delete`, 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=LogFileCodecTest`
   - [ ] `mvn test -pl phoenix-core -Dtest=LogFileFormatTest`
   - [ ] `mvn verify -pl phoenix-core -Dit.test=ReplicationLogGroupIT`
   - [ ] `mvn spotless:check`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to