Skip to content

Backport/051 hotfix online fixes - #6645

Merged
qin-ctx merged 6 commits into
release/v0.5.1-hotfixfrom
backport/051-hotfix-online-fixes
Oct 27, 2026
Merged

qin-ctx merged 6 commits into
release/v0.5.1-hotfixfrom
backport/051-hotfix-online-fixes

Conversation

@runyunzhou

Copy link
Copy Markdown
Collaborator

Description

Backport production storage and session fixes missing from release/v0.5.1-hotfix. The fixes remove redundant legacy session filesystem probes and query-time user registry refreshes, and prevent recursive deletion from removing its own lock token before the lease is released.

The backport preserves the 0.5.1 asynchronous AccountStore/TaskWorkStore architecture, MySQL/redis_mysql behavior, pagination, credential permissions, and lock handoff handling.

Human Involvement

  • A human participated in the implementation or review loop
  • This PR was generated entirely by AI agents without human participation in the loop

Related Issue

Related upstream/backport PRs: #6395, #6607, #6618, #6629, #6632, and #6642.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test update

Changes Made

  • Keep V1 multi-write metadata (.sync_log.json and .redirect.json) hidden from normal directory listings while retaining internal access for migration.
  • Add reconcile_existing_data to control historical primary-file scanning and backfill when multi-write initializes.
  • Make file-backed HTTP/MCP user listings read the in-memory registry by default. Preserve explicit fresh=True refresh, the asynchronous manager interface, and MySQL-backed listing behavior.
  • Move filesystem PathLock tokens to parent sidecars so recursive deletion retains mutual exclusion until release. Recheck target existence after acquiring the TreeLock and retain 0.5.1 service_name and pending-handoff cleanup.
  • Remove legacy session URI aliases and physical-path fallback probing. Update bundled callers, documentation, and regression tests to use canonical session paths.

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested this on the following platforms:
    • Linux
    • macOS
    • Windows

Relevant local validation passed with the candidate RAGFS Python extension rebuilt:

  • 355 Python tests covering admin/account APIs, user listings and explicit refresh, deletion behavior, and URI validation.
  • 139 VFS tests covering glob, grep, tree, actor visibility, and ACL behavior.
  • 43 Rust lock tests covering sidecars, legacy tokens, recursive deletion, handoff, and pending-handoff cleanup.
  • 1 Rust directory test covering sorting and visibility of leftover V1 metadata.
  • Ruff lint and git diff --check passed.
python -m pytest tests/server/test_admin_api.py \
  tests/server/test_api_key_manager.py \
  tests/storage/test_session_delete_storage.py \
  tests/unit/test_uri_validation.py \
  tests/unit/test_namespace_uri_classification.py -q --no-cov

python -m pytest tests/storage/test_viking_fs_glob.py \
  tests/storage/test_viking_fs_grep.py \
  tests/storage/test_viking_fs_tree.py \
  tests/storage/test_viking_fs_actor_peer_view.py \
  tests/storage/test_viking_fs_acl_locking.py -q --no-cov

cargo test --offline -p ragfs --lib lock:: -- --test-threads=4
cargo test --offline -p ragfs --lib test_read_dir_sorts_dirs_first_then_name

Checklist

  • My code follows the project's coding style
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Screenshots (if applicable)

N/A.

Additional Notes

Compatibility and rollout:

  • Normal APIs reject viking://session/... and no longer read either legacy physical session layout. Use canonical viking://user/<uid>/sessions/<sid> URIs. This change does not automatically relocate historical session data.
  • reconcile_existing_data defaults to false. Deployments that require historical backfill must explicitly enable it during initialization/migration; changing it after the metadata state is already stable does not restart scanning.
  • The filesystem lock protocol reads both legacy tokens and new sidecars, but writes new sidecars. Writers sharing a backend require the coordinated cutover described in the transaction documentation; old and new protocol writers must not write concurrently.

Validation limitations: Focused Mypy validation still reports existing type declaration gaps: 326 diagnostics on the target baseline versus 284 after the backport. There are no new diagnostic categories; the new post-lock stat adds one occurrence of the existing _OpsMixin._async_agfs declaration gap. Four files also retain formatter differences already present in the target baseline. No additional dependent PRs are required; release artifact publication and deployment remain separate steps.

Provenance: All commits retain their cherry picked from commit information. The 18 commits added to release/v0.5.0-hotfix since v0.5.0 were audited against the 0.5.1 implementation; 13 fixes were already covered, and five missing behaviors are backported here. d8dd90d9 is retained as an empty provenance commit because its changes are already present in the target branch.

Source commit Backport commit
236e3c46d 553689863
d8dd90d9 d58617016 (empty provenance commit)
ae29842f b79897947
5e45a875 aebeb95d8
36258b3d 45ddd62f2
14d622da a609d3f5a

qin-ctx and others added 6 commits October 27, 2026 11:49
(cherry picked from commit 2bef4c2)
(cherry picked from commit 236e3c4)

Co-authored-by: TRAE CLI <traecli@bytedance.com>
* fix(ragfs): 在外部租约下跳过冗余加密锁

(cherry picked from commit 002b27f)

* fix(multiwrite): 取消删除 v1 元数据时 glob 操作,在 import account 阶段进行删除 && 增加迁移阶段执行进度日志

(cherry picked from commit 42d99d8)
(cherry picked from commit d8dd90d)

Co-authored-by: TRAE CLI <traecli@bytedance.com>
Add a multi-write backup option to control whether startup scans pre-existing primary files into V2 metadata.

Document the default disabled behavior and the conditions where historical backfill can be skipped.

(cherry picked from commit 56e8bea)
(cherry picked from commit ae29842)

Co-authored-by: TRAE CLI <traecli@bytedance.com>
(cherry picked from commit 5e45a87)

Co-authored-by: TRAE CLI <traecli@bytedance.com>
* fix(storage): 修复递归删除导致 PathLock 提前失效

将目录锁迁移到父目录 sidecar,并兼容旧锁与 handoff;删除获锁后重新确认目标状态,避免并发请求沿用过期判断。

(cherry picked from commit 014bd7c)

* test(storage): 补充 PathLock 路径关系矩阵

使用共享文件系统上的独立 Manager 验证祖先、后代与兄弟路径的冲突和非冲突语义,防止 sidecar 迁移引入锁范围回归。

(cherry picked from commit c60e67a)

* fix(storage): 收敛 PathLock sidecar 迁移协议

拆分 Tree 路径解析并修正根路径寻址,撤回无关的 Snapshot 行为变化,同时明确新旧锁协议的切换约束,降低迁移影响范围。

(cherry picked from commit 10ec440)

---------

Co-authored-by: zhanghe.1216 <@bytedance.com>
(cherry picked from commit 36258b3)

Co-authored-by: TRAE CLI <traecli@bytedance.com>
Stop probing obsolete session storage paths during normal operations and
reject the legacy session URI alias. Update bundled callers to use current
session URIs.

(cherry picked from commit 68b1ea6)
(cherry picked from commit 14d622d)

Co-authored-by: TRAE CLI <traecli@bytedance.com>
@qin-ctx
qin-ctx merged commit 1d4784b into release/v0.5.1-hotfix Oct 27, 2026
2 checks passed
@qin-ctx
qin-ctx deleted the backport/051-hotfix-online-fixes branch October 27, 2026 05:07
@github-project-automation github-project-automation Bot moved this from Backlog to Done in OpenViking project Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants