Repository navigation
fix(ci): append the start-server config lines only once - #3371
Conversation
run-api-test.sh now starts the Server twice on the same configuration, first without authentication for CypherAnonymousApiTest and then with it (apache#3366). start-server.sh appended its config lines on every call, so with hstore the second start read usePD as '[true, true]' and failed with "Invalid value for key 'usePD'", which fails the API test step of the hstore job. Append each line only when the file does not already hold it. This also covers the two hbase timeouts and schema.sync_deletion, which were appended the same way.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3371 +/- ##
============================================
+ Coverage 54.31% 57.60% +3.29%
+ Complexity 2250 3 -2247
============================================
Files 770 507 -263
Lines 67952 48882 -19070
Branches 9213 7071 -2142
============================================
- Hits 36905 28160 -8745
+ Misses 27470 18024 -9446
+ Partials 3577 2698 -879
☔ 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: no. Summary: The append_once guard fixes the doubled usePD, hbase timeout and schema.sync_deletion lines for both starts in run-api-test.sh; the only gap is that CI on this PR does not run the hstore or hbase jobs that exercise the changed lines. Evidence: ran the head start-server.sh three times per backend (hstore, hbase, rocksdb) on one copy of the packaged conf with init-store.sh and start-hugegraph.sh stubbed, each appended line ends up exactly once; gh pr checks 3371 shows pd_store and compatibility / build-server-backends as SKIPPED; .github/scripts/ci-policy.py selects hstore for a hugegraph-dist path only when it contains pd, store or distributed.
| # Set usePD=true for hstore | ||
| if [ "$BACKEND" == "hstore" ]; then | ||
| echo "usePD=true" >> $REST_CONF | ||
| append_once "usePD=true" "$REST_CONF" |
There was a problem hiding this comment.
Minor: This line is the fix for the hstore job, but the CI of this PR never runs it: gh pr checks 3371 lists pd_store and compatibility / build-server-backends (hbase) as SKIPPED. .github/scripts/ci-policy.py maps a hugegraph-dist/ path to {server, docker, macos, macos_full} and adds hstore only when the path contains pd, store or distributed, so start-server.sh and run-api-test.sh never select hstore or hbase. That is how #3366 merged with the hstore API step broken, and the next change to these two scripts would hit the same blind spot. Requested change: add TRAVIS + "start-server.sh" and TRAVIS + "run-api-test.sh" to the planner with {hstore, hbase} (you offered this in the description; doing it here also lets this PR's own CI run the hstore API step instead of relying on the out-of-CI Ubuntu run).
There was a problem hiding this comment.
effa296 covers these lines without the hstore and hbase jobs. test-start-server.sh runs start-server.sh twice per backend and checks that usePD=true (hstore), both timeouts (hbase) and schema.sync_deletion=true (all backends) each end up once, only for their backend, and that the second start changes nothing. It runs in the rocksdb job, which every hugegraph-dist change selects, and fails on master's script. Touching server-tests.yml also selects the hbase job, so this PR's CI now runs the real hbase API step with both starts. The planner change is not in this PR: it would add hstore and hbase runs to every change to these two scripts, so it is a separate decision.
imbajin
left a comment
There was a problem hiding this comment.
Independent cross-review on 2026-10-17 at ae42b68cd0bab3d8b1dd3aaa04d8be70a069b1db: 8.5/10. No new blocking defect found in this narrow, one-file repair. I recommend prioritizing it as the shared startup dependency for 🔗 Server #3368 and 🔗 Server #3369, with the integration evidence limits below.
Two independent source/behavior passes checked the literal whole-line append guard and the actual two-start caller. In bounded cloud tests, the exact current start-server.sh, utility code and packaged configuration were exercised three times per backend (HStore, HBase, RocksDB and memory), with backend initialization and Server launch stubbed. Applicable properties remained present exactly once. Shell syntax passed; HBase's evaluation timeout and Java/JaCoCo launch arguments remained intact. This verifies script behavior, not live backend startup.
The implementation is appropriately small for sequential CI starts. It prevents adding a second identical line; it does not normalize already-duplicated keys, conflicting values or differently formatted properties, and it is not a concurrent configuration editor. Those limitations predate this fix and do not require expanding its scope.
The existing planner-coverage observation remains valid and is not repeated as a new inline finding: current CI skips HStore and HBase. The author's real Ubuntu negative/positive HStore API run (191 tests, zero failures/errors, 53 skipped on the fixed version) is useful separately attributed evidence; I did not independently rerun that Java/backend suite. A small committed repeat-start regression would help retain coverage even when the integration planner skips these jobs.
After this fix is on the tested base, the dependent PRs still need fresh integration evidence; their old failing workflows do not become successful retroactively.
run-api-test.sh starts the Server twice on one configuration, and the CI planner does not select the hstore or hbase jobs for a change to start-server.sh, so a regression there can merge unnoticed. Add test-start-server.sh, which runs start-server.sh twice for hstore, hbase, rocksdb and memory on a copy of the packaged config, with init-store.sh and start-hugegraph.sh stubbed. It fails when the second start changes the config, or when usePD, the two hbase timeouts or schema.sync_deletion is missing, set twice or set for the wrong backend. Run it in the rocksdb job with the other startup contract tests.
|
effa296 adds the repeat-start regression as a second commit on top of ae42b68. |
master now carries apache#3371, which makes the start-server.sh config lines idempotent and adds its own test-start-server.sh. Take master's start-server.sh, test-start-server.sh and server-tests.yml in place of this branch's equivalent fix; keep the CONTRACT_SUITES mapping, which master does not have.
Purpose of the PR
pd_store / hstoreand hbase jobs, which fails since fix(api): allow anonymous cypher queries #3366 on the PRs that run them: fix(pd): make PD reads and elections safe #3368 and fix(server): keep schema ids and graphs safe on truncate and auth clear #3369 for hstore, refactor: improve activation and local diagnosis tool #2945 for hbase.#3366 made
run-api-test.shstart the Server twice on the same configuration: first without authentication forCypherAnonymousApiTest, then with it.start-server.shappends its config lines on every call, so with hstore theinit-store.shof the second start readsusePDas[true, true]:With hbase the second start fails the same way on
restserver.request_timeout(#2945, run 39047184170, 2026-10-17):The CI of #3366 ran neither job (
pd_storeandcompatibility / build-server-backendswere skipped): apart frominstall-backend.sh, which selects both, the planner selects hstore for ahugegraph-distpath only when the path containspd,storeordistributed, and hbase only when the file name containshbase. No master push since then has touched PD or Store, so #3368 (run 39031115954) and #3369 (run 39032643888) are the first to run the hstore job after the merge, and both fail there. The last master run of the hstore job that finished passed, at 92af2f8 on 2026-10-14.#3355 makes the same
start-server.shchange in its 9e6dc50 (aset_propertyhelper) and adds its owntest-start-server.sh, so whichever of the two PRs lands second needs a rebase onto the other.Main Changes
start-server.shappends each config line only when the file does not already hold it (append_once, a whole-linegrep -qxF). This coversusePD=truefor hstore, the two hbase timeouts andschema.sync_deletion=true, which are appended the same way. rocksdb is not affected by the doubledschema.sync_deletionline, since no option is registered under that key (server-rocksdbpassed on fix(api): allow anonymous cypher queries #3366).test-start-server.sh(new, second commit) runsstart-server.shtwice for each backend (hstore, hbase, rocksdb, memory) on a copy of the packaged config, withinit-store.shandstart-hugegraph.shstubbed. It fails when the second start changes the config, or whenusePD, the two hbase timeouts orschema.sync_deletionis missing, set twice or set for the wrong backend. It runs in theCheck startup and native runtime contractsstep of the rocksdb job, which the planner selects for everyhugegraph-distchange, so it still runs when the hstore and hbase jobs are skipped.start-server.shorrun-api-test.shstill selects neither hstore nor hbase. This PR's CI runs the hbase job only because it now touchesserver-tests.yml, and it still skips hstore, so the hstore run below is from a Linux host. Selecting hstore and hbase for these two scripts in.github/scripts/ci-policy.pywould run the real backends on the next change too. I can add that here or in a follow-up if wanted.Verifying these changes
test-start-server.shon macOS (bash 3.2) and on Ubuntu 24.04 (bash 5.2), 2026-10-17: it passes with this change, and with thestart-server.shof master f5d9885 it fails 11 checks and exits 1. Count of each appended line after the two starts, as the test reports it:usePD=truerestserver.request_timeout=200andgremlinserver.timeout=200schema.sync_deletion=trueNegative control:
git show f5d9885a5:hugegraph-server/hugegraph-dist/src/assembly/travis/start-server.sh > /tmp/start-server.sh, thenhugegraph-server/hugegraph-dist/src/assembly/travis/test-start-server.sh /tmp/start-server.sh.The test also fails against three broken copies of
start-server.sh: one that writes nothing, one that appendsusePD=truefor every backend, and one whose second start exits 1.CI of this PR at effa296 (run 39052910053):
test-start-server.shpasses in theCheck startup and native runtime contractsstep of the rocksdb job (job 117455233209).The API test step of the hstore job, as
pd-store-ci.ymlruns it (mvn clean package,install-backend.sh hstore, thenrun-api-test.sh hstore target/site/jacoco), on Ubuntu 24.04 x86_64, JDK 17.0.20, 2026-10-17, with a fresh PD and Store for each run:start-server.shof master f5d9885: the first start andCypherAnonymousApiTest(2 run, 0 failures) pass, then theinit-store.shof the second start fails withInvalid value for key 'usePD': '[true, true]', andrun-api-test.shexits 1.CypherAnonymousApiTest: 2 run, 0 failures. API suite: 191 run, 0 failures, 0 errors, 53 skipped.run-api-test.shexits 0, andrest-server.propertiesholdsusePD=trueonce. The second commit does not changestart-server.sh.Does this PR potentially affect the following parts?
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.Doc - No Need: no user-visible documentation is affected.Documentation files in this PR or paired hugegraph-doc PR: