pallavithegod opened a new pull request, #3362: URL: https://github.com/apache/hugegraph/pull/3362
## Main Changes (主要改动) Close #3229. - Root cause: PD registered a Store as `Up` before `HgStoreEngine.restoreLocalPartitionEngine()` completed, restore errors were only logged, and shutdown left PD's Store record online until heartbeat expiry. - Fix details: register `Offline` to obtain the identity, restore local engines synchronously, and publish `Up` only after successful restore. Initialize engine owners before starting heartbeat producers; retry failed restoration while Offline. After stopping and joining producers, mark the local Store Offline and notify PD using fresh metadata. Preserve labels, Pending activation, duplicate checks, legacy Up registration and fatal-removal handling. PD outages retain heartbeat expiry as the fallback. Expose authenticated `heartbeatAgeMillis` so stale Up records are visible after abrupt stops. Document PD-first upgrades and retain manual Raft catch-up checks. - Tests: add `StoreRegistrationTest` for restore ordering, failed restore and shutdown notification/failure; `StoreRestoreRegistrationTest` for PD activation compatibility; and `StoreHeartbeatAgeTest` for stale, missing and future timestamps. Update `HeartbeatShutdownTest.testShutdownWaitsForDerivedStateCallbackAndRejectsLateUpdates` to require Offline after shutdown and reject late Up callbacks. All four focused classes pass, including native shutdown subprocess coverage. ## Verifying these changes (验证改动) - [x] Added/updated unit tests in `StoreRegistrationTest`, `StoreRestoreRegistrationTest`, `StoreHeartbeatAgeTest` and `HeartbeatShutdownTest` - [x] Verified `mvn checkstyle:check` and `mvn apache-rat:check` pass locally Java 17 / Maven 3.9.11 validation: - `mvn apache-rat:check` - `mvn editorconfig:format` - `mvn clean compile -Dmaven.javadoc.skip=true -pl hugegraph-store/hg-store-test,hugegraph-pd/hg-pd-test -am` - `mvn test-compile checkstyle:check -pl hugegraph-store/hg-store-test,hugegraph-pd/hg-pd-test -am -Dcheckstyle.config.location="$PWD/style/checkstyle.xml"` - `mvn test -pl hugegraph-store/hg-store-test,hugegraph-pd/hg-pd-test -am -Dtest=StoreRegistrationTest,StoreRestoreRegistrationTest,StoreHeartbeatAgeTest,HeartbeatShutdownTest -Dsurefire.failIfNoSpecifiedTests=false` The explicit Checkstyle configuration selects the repository's rules. `Up` confirms local restore; fresh heartbeats and the existing per-group checks remain necessary for rolling replacements. -- 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]
