contrueCT opened a new pull request, #3153:
URL: https://github.com/apache/hugegraph/pull/3153

   ## Purpose of the PR
   
   - close #3095
   - HStore prefixes each physical key with a graph ID. When a graph's first 
write arrived through batch PUT or MERGE, `TxBuilderImpl` used `getKey()`, 
which returned the reserved missing graph ID (`65534`, or `0xFFFE`) instead of 
allocating one. Multiple new graphs could therefore share the same physical-key 
prefix: PUT could overwrite another graph's value, MERGE could combine counters 
across graphs, and graph-scoped truncate could remove another graph's data.
   - This PR extracts the focused #3095 fix from 
https://github.com/hugegraph/hugegraph/pull/163. It prevents new batch writes 
from using the missing graph ID. It intentionally does not repair already 
affected data or include the later GraphIdManager lifecycle, deadlock, or 
ID-reuse changes from that PR.
   
   ## Main Changes
   
   - Allocate a graph ID through `getKeyOrCreate()` before encoding keys for 
batch PUT and MERGE.
   - Add `BatchGraphIsolationTest` using the real `BusinessHandler.doBatch()` 
and RocksDB path to verify:
       - the same logical key keeps distinct PUT values in two graphs;
       - truncating one graph preserves the other graph's value;
       - MERGE counters remain isolated between graphs.
   - Register the regression test in the existing `store-core-test` Maven 
execution.
   - Keep the existing physical-key format, public APIs, dependencies, and 
configuration unchanged.
   
   ## Verifying these changes
   
   - [ ] Trivial rework / code cleanup without any test coverage. (No Need)
   - [ ] Already covered by existing tests, such as *(please modify tests 
here)*.
   - [x] Need tests and can be verified as follows:
       - `mvn test -pl hugegraph-store/hg-store-test -am -P store-core-test 
-Djacoco.skip=true -ntp`
       - `mvn clean compile -Dmaven.javadoc.skip=true -ntp`
   
   ## Does this PR potentially affect the following parts?
   
   - [ ]  Dependencies ([add/update 
license](https://hugegraph.apache.org/docs/contribution-guidelines/contribute/#321-check-licenses)
 info & 
[regenerate_known_dependencies.sh](../install-dist/scripts/dependency/regenerate_known_dependencies.sh))
   - [ ]  Modify configurations
   - [ ]  The public API
   - [ ]  Other affects (typed here)
   - [x]  Nope
   
   ## Documentation Status
   
   - [ ]  `Doc - TODO`
   - [ ]  `Doc - Done`
   - [x]  `Doc - No Need`


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to