bitflicker64 opened a new pull request, #3369:
URL: https://github.com/apache/hugegraph/pull/3369
## Purpose of the PR
- Related to #3242. The 1.8.0 checklist asks for these Server fixes to be split out from the schema cache sync work (#3235).
Two Server bugs and one missing regression test, found while working on schema sync. None of them depends on the sync protocol.
## Main Changes
1. `fix(server): keep the schema id counters on hstore truncate`
`HstoreSessionsImpl.truncate()` called `resetIdByKey()` for the store's graph name. For the schema store that is `{graphspace}/{graph}/m`, so PD dropped every schema id counter of the graph, while the schema itself stays in PD meta and survives the truncate. The truncating Server kept handing out ids from its cached range, but any other Server, or the same one after a restart, got ids from 1 again and reused the ids of existing schema elements. Truncate no longer resets the counters.
2. `fix(server): delete only auth keys in the graphspace auth clear`
`clearGraphSpace()` deletes `HUGEGRAPH/{cluster}/GRAPHSPACE/{gs}/AUTH` by prefix. Graph keys sit beside `AUTH` under the graphspace, so the prefix also matched every key of a graph named `AUTH` or named with `AUTH` at the start, such as `AUTHx`, and wiped its schema and task keys. Graph names created through the API are lower case, so only an upper-case name loaded from local config or meta can hit this. The clear now deletes the five kinds of graphspace auth keys (`ROLE`, `TARGET`, `BELONG`, `ACCESS`, `PROJECT`), each up to its path delimiter, and nothing else under `AUTH`.
3. `test(server): cover the graph space clear for names sharing a prefix`
`GraphManager.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`. #3308 now matches the key up to the delimiter. This commit adds the regression test for that behaviour.
## 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:
- New tests: `MultiGraphsTest#testHstoreTruncateBackendKeepsSchemaIdCounters`, `AuthMetaManagerTest#testClearGraphAuthKeepsGraphsNamedLikeAuth`, `GraphManagerClearGraphSpaceTest#testClearKeepsGraphsOfSpacesNamedLikeIt`.
- Run on this head (bfb021c83) on 2026-10-17, JDK 17.0.20, Linux x86_64:
- `mvn test -pl hugegraph-server/hugegraph-test -am -P unit-test`: 1295 run, 0 failures, 0 errors, 8 skipped.
- With the old `startsWith(name)` match put back in `GraphManager.clearGraphSpace()`, `testClearKeepsGraphsOfSpacesNamedLikeIt` fails.
- `mvn editorconfig:check`: clean.
- Run on the earlier version of these commits, on base 000d538ab, on 2026-10-11 (commit 3 then also carried the `GraphManager` change that #3308 has since made upstream):
- `mvn test -pl hugegraph-server/hugegraph-test -am -P core-test,hstore` against PD and Store started from the packaged dists with `install-backend.sh hstore`, as in CI: 928 run, 0 failures, 0 errors, 53 skipped.
- With the old `HstoreSessionsImpl.java` put back, the new truncate test fails with `id 1 reused after 20001`.
- With the old `AuthMetaManager.java` put back, `testClearGraphAuthKeepsGraphsNamedLikeAuth` fails. It also fails with a version that only ends the prefix at `AUTH/`, which still deletes the keys of a graph named `AUTH`.
- Not run locally: the API tests. CI runs those.
## 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
Select one option and provide the documentation location when applicable.
- [ ] `Doc - TODO`: required documentation is pending; complete it before merging.
- [ ] `Doc - Done`: documentation is included here or linked below.
- [x] `Doc - No Need`: no user-visible documentation is affected.
Documentation files in this PR or paired hugegraph-doc PR:
--
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: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org
imbajin merged PR #3369: URL: https://github.com/apache/hugegraph/pull/3369 -- 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: issues-unsubscribe@hugegraph.apache.org For queries about this service, please contact Infrastructure at: users@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org For additional commands, e-mail: issues-help@hugegraph.apache.org
codecov[bot] commented on PR #3369:
URL: https://github.com/apache/hugegraph/pull/3369#issuecomment-6234107201
## [Codecov](https://app.codecov.io/gh/apache/hugegraph/pull/3369?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:x: Patch coverage is `0%` with `7 lines` in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 42.29%. Comparing base ([`92af2f8`](https://app.codecov.io/gh/apache/hugegraph/commit/92af2f89c320c3e6fa7c10765a061f3edadea319?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`bfb021c`](https://app.codecov.io/gh/apache/hugegraph/commit/bfb021c83e0c255f0a4fc990f67ff11e6c506e5e?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 29 commits behind head on master.
| [Files with missing lines](https://app.codecov.io/gh/apache/hugegraph/pull/3369?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [...pache/hugegraph/meta/managers/AuthMetaManager.java](https://app.codecov.io/gh/apache/hugegraph/pull/3369?src=pr&el=tree&filepath=hugegraph-server%2Fhugegraph-core%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fhugegraph%2Fmeta%2Fmanagers%2FAuthMetaManager.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aHVnZWdyYXBoLXNlcnZlci9odWdlZ3JhcGgtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaHVnZWdyYXBoL21ldGEvbWFuYWdlcnMvQXV0aE1ldGFNYW5hZ2VyLmphdmE=) | 0.00% | [7 Missing :warning: ](https://app.codecov.io/gh/apache/hugegraph/pull/3369?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #3369 +/- ##
=============================================
- Coverage 54.31% 42.29% -12.02%
+ Complexity 2250 2 -2248
=============================================
Files 770 507 -263
Lines 67952 48886 -19066
Branches 9213 7072 -2141
=============================================
- Hits 36905 20678 -16227
+ Misses 27470 25808 -1662
+ Partials 3577 2400 -1177
```
| [Flag](https://app.codecov.io/gh/apache/hugegraph/pull/3369/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [server_rocksdb](https://app.codecov.io/gh/apache/hugegraph/pull/3369/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `42.29% <0.00%> (?)` | |
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/hugegraph/pull/3369?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
</details>
--
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: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org