Skip to content

fix(hstore): invalidate graph registration after clear - #3141

Open
ulofiai wants to merge 1 commit into
apache:masterfrom
ulofiai:fix/issue-3090
Open

fix(hstore): invalidate graph registration after clear#3141
ulofiai wants to merge 1 commit into
apache:masterfrom
ulofiai:fix/issue-3090

Conversation

@ulofiai

@ulofiai ulofiai commented Aug 7, 2026

Copy link
Copy Markdown

Fixes the HStore clear/recreate lifecycle defect described in #3090.

This focused change invalidates the local infoInitializedGraph marker after a successful store-side graph deletion. The marker is cleared in a finally block, so a later open() can re-register the same graph even when the PD deletion call reports an error.

A regression test repeats the initialization-state add/clear transition 50 times to guard against stale JVM lifecycle state.

Validation:

  • git diff --check
  • Java 11 syntax parsing for both modified sources
  • patch apply and reverse-apply checks against the supplied base snapshot

Maven tests were not run because Maven is unavailable in the execution image.

Signed-off-by: ulofiai <monsterking@tutamail.com>
@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. bug Something isn't working store Store module tests Add or improve test cases labels Aug 7, 2026

@imbajin imbajin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking: no. Summary: The production change clears the stale registration marker after graph deletion, but the added regression test only exercises the private helper and does not validate the public clear/recreate lifecycle. Evidence: Static review of HstoreSessionsImpl.clear() and HstoreSessionsImplTest.testClearInitializedGraphStateRepeatedly(); no CI checks reported for this exact head.

try {
for (int i = 0; i < 50; i++) {
Assert.assertTrue(initializedGraphs.add(graphName));
clearInitializedGraph.invoke(null, graphName);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ This test invokes private clearInitializedGraph() via reflection instead of exercising HstoreSessionsImpl.clear(). It would still pass if the finally call at HstoreSessionsImpl.java:188 were removed or misplaced, and it does not verify the reported clear/recreate lifecycle. Please cover the public clear path (ideally the repeated clear/recreate sequence) and assert that a subsequent open re-registers the graph, or use controllable fakes to verify that behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:XS This PR changes 0-9 lines, ignoring generated files. store Store module tests Add or improve test cases

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

2 participants