Skip to content

fix(rocksdb): retain Topling OLAP handles - #3299

Open
contrueCT wants to merge 1 commit into
apache:masterfrom
contrueCT:fix/topling-olap-clear
Open

contrueCT wants to merge 1 commit into
apache:masterfrom
contrueCT:fix/topling-olap-clear

Conversation

@contrueCT

@contrueCT contrueCT commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Purpose of the PR

Topling's standalone OLAP property clear still drops and recreates the same column family. The previously reported real-JNI reproduction completes the clear task, then aborts during normal shutdown. This change clears the selected table while retaining its CF handle.

Addresses the OLAP clear/close item already tracked in #3242 and the original review. The release checklist stays open. Existing Topling and recovery PRs were checked; the merged runtime integration and snapshot-recovery fix #3293 do not cover this clear path.

Main Changes

  • Clear the selected OLAP table in its owning database under the store write lock.
  • Retain Topling CF handles and discard the clearing thread's pending batch before committing the clear; leave other threads' leases untouched.
  • Preserve the standard RocksDB drop/create path.
  • Adapt OLAP test fixtures to the shared AtomicReference owner introduced by merged fix(rocksdb): make snapshot restore retryable #3293.

Verifying these changes

  • Trivial rework / code cleanup without any test coverage. (No Need)
  • RocksDBSessionsTest: 28 tests pass on Java 17 after rebasing onto master 87a06a9b, with no failures/errors/skips. New tests cover retained handle identity, repeated clears, pending writes outside the stored range and in an empty table, independent OLAP routing, other-table preservation, reuse and close/reopen reads.
  • Whole-repository Java 17 clean compilation, editorconfig formatting and git diff --check pass.

These tests run the Topling Java branch with the real standard RocksDB JNI. The same handle-preservation regression fails against the original master adapter. Actual Topling JNI and its reported shutdown abort were not rerun on this macOS arm64 host; current-head Linux native qualification remains necessary.

Does this PR potentially affect the following parts?

  • Dependencies
  • Modify configurations
  • The public API
  • Other affects: standalone Topling OLAP clear and native handle lifecycle
  • Nope

Documentation Status

  • Doc - TODO
  • Doc - Done: docs/storage-lifecycle.md documents OLAP clear, handle retention and pending-write handling.
  • Doc - No Need

@codecov

codecov Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 41.71%. Comparing base (87a06a9) to head (34cc360).

Files with missing lines Patch % Lines
.../hugegraph/backend/store/rocksdb/RocksDBStore.java 0.00% 16 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3299      +/-   ##
============================================
- Coverage     41.92%   41.71%   -0.22%     
+ Complexity     7101     7037      -64     
============================================
  Files           770      762       -8     
  Lines         67320    67066     -254     
  Branches       9042     9022      -20     
============================================
- Hits          28226    27974     -252     
- Misses        35879    35880       +1     
+ Partials       3215     3212       -3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@contrueCT
contrueCT marked this pull request as draft October 9, 2026 13:52
@contrueCT
contrueCT force-pushed the fix/topling-olap-clear branch from a440bdc to 6a068b9 Compare October 10, 2026 04:44
@contrueCT
contrueCT marked this pull request as ready for review October 10, 2026 04:50
Clear OLAP data without dropping its column family.
Route the clear to the owning database under the store lock.
Discard only the clearing threads pending batch.
Cover handle identity, other tables, reuse and reopen.
@contrueCT
contrueCT force-pushed the fix/topling-olap-clear branch from 6a068b9 to 34cc360 Compare October 10, 2026 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants