bitflicker64 opened a new pull request, #755:
URL: https://github.com/apache/hugegraph-toolchain/pull/755

   > Based directly on `master`. This branch contains the 7 bug-fix commits 
rebased after #23 was squash-merged, plus three append-only follow-up commits 
from distributed validation and bot review.
   
   ## Summary
   
   Bug fixes for Hubble found during a focused exploration pass, followed by a 
code audit of the surrounding paths. 10 commits, 62 files.
   
   Findings were originally gathered against a single deployment shape: the 
all-in-one `hugegraph/hugegraph:latest` image, RocksDB backend, standalone mode 
with PD disabled. The fixes have since been re-validated against a distributed 
deployment (3 PD, 3 Store, 3 Server, PR-head Hubble).
   
   The standalone fixes are complete and the repository-native regression 
baseline remains green. The live distributed round found no 
distributed-specific production compatibility correction was needed; its first 
follow-up added a regression test for the negative `page_size` rejection. Two 
later bot-review commits narrowly harden concurrency, migration, 
stale-response, retention, and launcher process-identity edges in those same 
documented fixed paths.
   
   ## What this fixes
   
   **Query console**
   
   - Every Cypher query containing a relationship pattern died as a raw Tomcat 
400, because brackets were un-escaped in the query string. Query params are now 
fully percent-encoded.
   - Real server errors were swallowed and shown as "Invalid response from 
server" when the error status was embedded in a 200 body.
   - Cypher results never rendered on the graph canvas, always falling back to 
raw JSON, because rows arrive as variable-keyed maps rather than vertex/edge 
objects.
   - The Gremlin limit rewriter split statements on `;` without understanding 
quoted text, silently corrupting any query with a semicolon in a string 
literal. Comment handling is covered too, including an apostrophe inside a line 
comment.
   - `page_size` of `-1` (and any negative value) bypassed pagination entirely, 
allowing unbounded reads.
   
   **Import and load lifecycle**
   
   - Pausing or stopping a task that outlived a Hubble restart threw a server 
error, leaving the job permanently stuck: pause failed, stop failed, resume was 
refused, delete failed.
   - Clearing uploaded files removed the database rows but left the files on 
disk, and never released the upload quota, so the limit crept upward until new 
uploads were refused.
   - Viewing the failure reason for a job whose uploaded file had been deleted 
threw instead of reporting that no error file exists. The response also carried 
the job id in the field meant for the task id.
   - Deleting a file or task during a running import is now rejected; 
previously the loader kept writing with no visible task.
   - Resume, stop and retry all reported that pausing was not permitted, and 
roughly two dozen messages rendered as raw keys such as 
`load.task.pause.no-permission`. Both locales now have real text.
   
   **Display and layout**
   
   - The graph list and graphspace cards invented a creation date of "today" 
for records with no date, because formatting an undefined value returns the 
current time.
   - The graph list and import task tables forced the whole page to scroll 
sideways at normal laptop widths, pushing row actions off-screen.
   - The edge type property dropdown silently showed only the first page of 
properties, and one option was spelled `lable`.
   - The duration formatter dropped months and years, so a 35-day span 
displayed as roughly 4 days plus a 2.6 billion millisecond remainder.
   
   **Durability and operations**
   
   - A migrator adds columns missing from databases created by older releases, 
which previously made saved queries and history unreadable after an upgrade.
   - The launcher no longer sends `SIGKILL` before H2 flushes, which could lose 
up to a second of committed writes.
   - Five missing indexes added to list queries that were doing full table 
scans.
   - Log level filter ranked `TRACE` as most severe, so selecting `ERROR` 
returned `TRACE` noise. Log export issued empty queries past the end of results.
   - The graph statistics cache was cleared globally on every request, and the 
same structure was mutated without synchronisation.
   - Deleting a batch of graph elements with a duplicated edge id failed midway 
and discarded the edit history of everything already deleted.
   
   ## Testing
   
   - `hubble-be`: **425 tests pass** on JDK 11, against the rebased `master` 
head. No failures, no errors.
   - `hugegraph-client` and `hugegraph-loader` build successfully on JDK 11.
   - 13 of these fixes were verified through the browser with network and 
console monitoring plus server logs. The remaining audit-driven fixes use 
code-path evidence plus the repository-native suites; not every item has a 
dedicated test fixture.
   - `hugegraph-client` integration tests were not run in the original 
standalone round; they require a live server on `:8080`.
   - At reviewed hardening head `47733e63`, all required GitHub workflows 
passed, including Hubble, client, loader, tools, Spark, license, dependency 
review, and CodeQL. Focused backend regressions passed 33/33, frontend 
validation passed 148 suites / 827 tests plus lint and production build, and 
the full JDK 11 six-module package/distribution reactor passed. Final 
launcher-only head `65dcf2b9` adds the targeted legacy-PID ownership 
correction; both scripts pass syntax checks and the isolated actual-script 
regression passes.
   
   ## Distributed-mode validation
   
   This round re-ran only the established regressions for the documented fixed 
set against an isolated 3 PD + 3 Store + 3 Server deployment with Hubble built 
from validated production head `e4f8f8a4`. All ten containers and health 
endpoints were healthy during validation; Hubble login succeeded in PD mode, 
and Operations reported 1 logical Server, 3 PD, and 3 Store nodes, all `UP`. 
`LiveOperationsCollector` intentionally represents the selected PD-discovered 
Server client as one logical Server node rather than enumerating all three 
healthy Server containers. Later follow-ups are covered by focused 
backend/frontend/package and launcher regressions rather than a repeated 
browser bug hunt.
   
   - **Applicability:** 32 of 34 fixes are distributed-applicable, BUG-023 is 
partially applicable because PD supplies a real GraphSpace creation date, and 
BUG-032 is standalone-only because it concerns the no-Store branch and Server 
1.7 does not expose the legacy `/hstore` management API. Both supporting 
changes are distributed-applicable. The evidence-backed per-item matrix is in 
the distributed-validation comment.
   - **Queries and UI:** relationship Cypher succeeded through graphspace-aware 
PD authentication and rendered 2 nodes / 1 edge; invalid Cypher surfaced the 
real parse error; the Gremlin string/comment regressions passed; the documented 
graph, task, edge-property, timestamp, and request-guard UI behaviors passed.
   - **Loader and uploads:** a graphspace-scoped one-row Loader job reached 
`SUCCEED` at 100%; `.exe` upload was rejected, a control CSV was accepted, and 
the accepted upload was cleaned up.
   - **Pagination:** live `page_size=-2` returned application status 400 in the 
JSON body (HTTP 200) while the legacy `-1` sentinel remained accepted. 
Follow-up commit `89df96c0` adds the focused interceptor regression test; no 
production code changed in the distributed round.
   
   ## OrbStack single-cluster follow-up
   
   A narrow local follow-up exercised PR-head Hubble at `65dcf2b9` against one 
distributed HugeGraph cluster in OrbStack: 1 PD, 1 Store, and 1 Server. All 
four containers and public health endpoints were healthy; Hubble login 
succeeded in PD mode with SUPERADMIN context; and Operations reported exactly 1 
Server, 1 PD leader, and 1 Store, all `UP`.
   
   - **Passed:** relationship Cypher execution, concrete invalid-Cypher error 
propagation, `page_size=-2` rejection, and the supported `page_size=-1` 
sentinel.
   - **Deferred at the Server boundary:** the two established Gremlin parser 
executions could not reach parsing because the tested HugeGraph Server accepted 
the same freshly issued Bearer token on REST but returned HTTP 401 on embedded 
`/gremlin`. Runtime token secrets matched, Basic authentication reached the 
Gremlin engine, and three Bearer retries reproduced the result. This is not 
evidence of a PR #24 parser regression; HugeGraph Server source is outside this 
PR, so no workaround or unrelated code change was made.
   - The earlier 3×3 distributed run remains the passing live evidence for the 
Gremlin string/comment behaviors.
   
   ## Notes for review
   
   - This includes two small `hugegraph-client` changes (`CypherManager`, 
`HugeClient`). Happy to split them into a separate PR if you would rather keep 
the client library separate from the application.
   - It also carries a schema migration that adds columns for databases created 
by older releases. Worth a look on its own.
   - Distributed-mode validation and the resulting hardening are complete; the 
PR is ready for maintainer review.
   
   
   <!-- This is an auto-generated comment: release notes by coderabbit.ai -->
   ## Summary by CodeRabbit
   
   * **新功能**
     * 支持按图空间和图保留执行记录,增强 Cypher、图元素查询及数据导入能力。
     * 新增旧版数据库自动迁移、分页限制和文件任务状态校验。
     * 改进文件上传、删除、任务管理及资源清理流程。
   
   * **问题修复**
     * 优化异常提示、日志导出、进度计算、时间显示和空数据处理。
     * 修复属性标签、排序、查询脚本解析及批量删除问题。
     * 服务停止支持优雅退出,超时后再强制停止。
   
   * **测试**
     * 增加数据库迁移、记录保留、脚本解析、分页及上传流程测试。
   <!-- end of auto-generated comment: release notes by coderabbit.ai -->
   
   ## Maintainer-review follow-up
   
   The standalone and distributed validation rounds above are unchanged. This 
separate round addresses review findings on those fixes without expanding the 
documented bug scope.
   
   - `8f8258be` resolves the eight maintainer findings covering migration 
ordering and legacy visibility, scoped saved-query uniqueness, multiline 
Gremlin rewriting, resumable-file protection, atomic quota accounting, HStore 
error mapping, and stale modal callbacks.
   - `b314c7b0` resolves the three follow-up CodeRabbit findings: column-aware 
legacy backfill, upload-move compensation after database rollback, and 
order-independent scoped-constraint assertions. The upload fallback also 
retains a cleanup record, blocks retry overwrite, preserves quota accounting, 
and validates missing-path parents against symlink escape.
   - Focused JDK 11 validation passed: `LegacySchemaStartupTest` 4/4 and the 
final upload/transaction set 25/25. Checkstyle and `git diff --check` pass. The 
same ten-container 3 PD + 3 Store + 3 Server + Hubble environment was restored 
healthy after validation.
   - Exactly three read-only implementation reviewers re-reviewed the final 
candidate and reported no unresolved high-severity finding. Live MySQL/MariaDB 
upgrade execution remains the recorded medium coverage residual; H2 behavior 
and generated MySQL migration SQL are covered.
   - Direct evidence-backed replies were posted on all eight maintainer threads 
and all three CodeRabbit threads.


-- 
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]

Reply via email to