Repository navigation
refactor(core): drain tasks before graph deletion - #3308
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #3308 +/- ##
============================================
+ Coverage 52.67% 52.74% +0.07%
- Complexity 2070 6126 +4056
============================================
Files 770 770
Lines 67694 67937 +243
Branches 9172 9210 +38
============================================
+ Hits 35655 35835 +180
- Misses 28489 28544 +55
- Partials 3550 3558 +8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
bitflicker64
left a comment
There was a problem hiding this comment.
Blocking: yes. Summary: The deletion ordering and the retained registrations work as described, but three paths behave differently from master for callers that are not retrying a failed deletion: a drop with the local scheduler no longer waits task.wait_timeout for short tasks, a plain close of the distributed scheduler cancels dispatched tasks that never started, and reload() stops halfway when one graph cannot close. Evidence: read the full diff 87a06a9..9918ff2 (14 files, +3653/-169) and the surrounding code in GraphManager, StandardHugeGraph, TaskManager, HugeTask and both schedulers; built both trees with JDK 17 (mvn -pl hugegraph-server/hugegraph-test -am install -DskipTests) and ran one JUnit probe on each: dropping a memory graph while a 1.5 s task runs returns after 1720 ms on 87a06a9 and throws after 0 ms on 9918ff2; the scheduler-close and reload() points are from reading the code and from the assertions in DistributedTaskAdmissionTest, not from a run. All check runs at 9918ff2 are green or skipped.
096f748 to
5eb2fc0
Compare
|
The scope has been narrowed to local task admission, physical execution/callback drain, and safe graph deletion. Global lifecycle coordination, hot reload restoration, cross-Server notification reconciliation, task-record deletion recovery, and fallback executors have been removed from this PR and recorded for separate work. Previous descriptions claiming those broader guarantees are superseded. Configuration changes require a restart while reload recovery is deferred; all Servers must stop writes and tasks before deletion. The broader website documentation PRs are now drafts pending reconciliation. Core regression tests and clean compilation passed. The missing-graph fixture now uses normal GraphManager construction and still requires the original IllegalArgumentException. Current-head Linux CI and complete coverage are pending. |
bitflicker64
left a comment
There was a problem hiding this comment.
Blocking: yes. Summary: The drain-before-delete ordering and the retained registrations hold up on reading, but two effects reach callers that are not retrying a deletion: TaskManager.shutdown() now throws before stopping any executor when a scheduler is still registered, and a refused drop leaves the local scheduler closed for good on a graph that is kept. Evidence: read the full diff 68fb045..bb3ebc8 (14 files, +1789/-146) and the surrounding code in GraphManager, StandardHugeGraph, TaskManager, HugeTask, HugeFactory, HugeGraphServer and both schedulers; both findings are static, from the head source and the assertions in StandardTaskAdmissionTest and HugeFactoryTest, and no test was run for this review. All check runs at bb3ebc8 are green or skipped.
|
Source cross-check of the current memory CI error: Both |
- fence admission and track actual execution owners - wait for callbacks and transaction cleanup before deletion - retain graphs and schedulers when draining fails - keep core regressions and defer reload coordination
- fence close without holding the cron monitor across queries - test the real cron barrier timeout and close retry - wait for callable entry before asserting task deletion
- wait for actual ephemeral task drain before absence checks - use current input time for TTL start timestamps - verify exact expiry while retaining all query assertions
- preserve executor grace with retained schedulers - explain task admission after refused graph deletion - verify shutdown callbacks and retained graph data
- wait for provide to return before injected failure - preserve await exception and timeout assertions - release the existing gate during test cleanup
4108670 to
337d7b6
Compare
|
Addressed the Memory CI fixture race in the four-line test correction. The existing gate now holds the injected consumer failure until provide() returns. The original await() RuntimeException/message assertions, one-second test timeout and executor cleanup are unchanged; production Consumers is unchanged. A controlled real-consumer post-offer interleaving reproduced the old failure escaping from provide(), then confirmed the gated version reports that same exception from await(). All ConsumersTest cases, formatting and the clean reactor compile passed. The diagnostic queue observer is external evidence only. The branch is rebased onto current ASF master; Java/POM/proto/config sources match the tested version. Latest-head Linux CI and full coverage are still pending. |
clearGraphSpace() used to pick the graphs and services to drop by
checking that their "{graphspace}-{name}" key starts with the graph
space name, so clearing "gs" also dropped the graphs and services of
"gs2" and "gs_x". apache#3308 now matches the key up to the
delimiter. Add the regression test for that behaviour.
A cancelled task can still be executing or saving its completion callback. Graph deletion previously treated logical cancellation or a failed scheduler close as sufficient to remove data and registrations. This change waits for the actual local owners to exit first.
flowchart LR A[Stop task admission] --> B[Drain execution, callbacks and transaction cleanup] B -->|Drained| C[Delete graph data] B -->|Timeout| D[Keep task admission closed; retry deletion]Scope is intentionally limited to local task shutdown and safe deletion. Stop writes and tasks on every Server before maintenance, and do not recreate the same graph name until deletion completes. Backend/metadata deletion is nontransactional; errors after destructive cleanup require operator inspection. Owner-cleanup failure does not count as a successful drain.
Hot reload recovery, cross-Server notification reconciliation, same-name replacement and task-record deletion policies are deferred to separate work. Use a restart for configuration changes. Their full source is preserved outside this PR; no global lifecycle coordinator or fallback executor is added.
Validation: formatting, clean reactor compilation and focused scheduler/deletion/permission/task/TTL regressions passed. Separate Memory and RocksDB processes verify that a real pending task persists its terminal record during global shutdown while graph data, configuration and scheduler registration remain intact. The latest head passed Linux Memory/HStore, macOS Intel/ARM and Commons/RPC suites. Complete coverage retains every baseline source file, includes RPC, and passes both coverage checks. Org test jobs also passed; its two final input-validity checks ran after the PR was closed and correctly rejected the closed PR. These are not reported as green checks.
See
docs/server-runtime.mdfor the maintenance contract. Paired source: org #285 / ASF #3308. The broader website documentation #519 is held as a draft pending scope reconciliation and is not a merge prerequisite.Conceptual overview
Conceptual diagram; not runtime test evidence.