Skip to content

fs: 目录列举给裸名;目录 key 的 get/get_part 派生 index(#250) - #29

Merged
miaobyte merged 1 commit into
mainfrom
fix/fs-dir-list-and-get
Sep 14, 2026
Merged

miaobyte merged 1 commit into
mainfrom
fix/fs-dir-list-and-get

Conversation

@miaobyte

Copy link
Copy Markdown
Contributor

变更(对齐 redis 后端,issue #250)

1. list 的成员前缀目录不再扁平展开

原来把 string· 展开为全部 string·<成员> —— 父目录会列出所有后代,递归遍历/重建(layout dumptutorial/07-lib/walk_lib.kv)再也对不上父子层级。改为发射去 OBJ_SEP裸名,与存储索引登记成员前缀节点的方式一致。

2. get_raw / get_part 对目录 key 派生 index XValue

目录 key 在 fs 没有落盘索引(FS 自身即索引),原先直接返回空 → head 读前缀拿到 nil。现在按需 dir_value().encode() 再返回/切片,与「目录 key get 返回容器 XValue」一致。

背景

排查 kvlang CI 的 test-fs 超时时发现:kvspace·listlen("/lib/string/") 在 fs 后端返回 0(深层列举拿不到成员)—— 正是 #250 记录的缺口(durable-fs 嵌套容器 memindex 取不回)。

待验证

  • 三后端 tutorial 一致
  • layout dump 往返(round-trip)不受影响

Closes #250

🤖 Generated with Claude Code

两处对齐 redis 后端(issue #250):

1. list 的成员前缀目录不再扁平展开
   原来把 "string·" 展开为全部 "string·<成员>",父目录会列出所有后代,
   递归遍历/重建(layout dump、walk_lib)再也对不上父子层级。
   改为发射去 OBJ_SEP 的裸名 —— 与存储索引登记成员前缀节点的方式一致。

2. get_raw / get_part 对目录 key 派生 index XValue
   目录 key 在 fs 没有落盘索引(FS 自身即索引),原先直接返回空 →
   head 读前缀拿到 nil。现在按需用 dir_value().encode() 再返回/切片,
   与「目录 key get 返回容器 XValue」一致。

Closes #250

Co-Authored-By: Claude Code <noreply@anthropic.com>
@miaobyte
miaobyte merged commit 6ac4fad into main Sep 14, 2026
4 checks passed
@miaobyte
miaobyte deleted the fix/fs-dir-list-and-get branch September 14, 2026 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant