Upstream deletes from the container are dropped as stale: tombstoneIsStale compares revs from different peers' rev spaces
Maintainer thường phản hồi trong vòng 1 ngày
@aron-cf đang làm issue này rồi.
Từ ngày 29/9/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Summary
Deletes made inside the container (rm, and therefore mv) are never applied to the Durable Object's VFS once the DO's local revision counter is ahead of computerd's. tombstoneIsStale compares revisions from two unrelated counters.
Environment
@cloudflare/computer0.3.1 withcomputer-computerd-linux-x64:0.3.1.withWorkspaceContainer+CloudflareContainerBackend, standard-1.- Same code on
main(e5e28a7).
What happens
- A workspace has some history. Local writes via
ws.fs.writeFilebumpvfs_meta.rev, and so does every file pulled back from the container, becauselinkStagedChunksSyncstamps it with a fresh local rev. ws.runtime.exec('rm x', { backend: 'linux' }).- The container's
lsno longer showsx, andresult()reportssync.status: 'complete',pulled: 0. xis still in the DO's VFS. It is never re-pushed, because it did not change locally, so the two sides stay diverged. Amv a barrives as "b created, a still present".
Files created in the container do propagate, because alreadyApplied compares manifest hashes, not revs.
Cause
packages/dofs/src/sync/apply.ts:
function tombstoneIsStale(db, entry) {
const live = resolveInode(db, entry.path, { followSymlinks: false });
if (live === null) return false;
const row = db.one("SELECT rev FROM vfs_nodes WHERE inode = ?", live.inode);
return row !== undefined && row.rev > entry.rev;
}
row.revis the local node's rev (localvfs_meta.revspace).- For an upstream entry,
entry.revcomes from the peer's change log (computerd's own counter). packages/rpc/src/server.tsitself describes the push caller as "a sync peer with its own rev space".
computerd starts fresh after every sleep, so its counter is small, while the DO's grows with every write and pull. row.rev > entry.rev therefore holds for practically every path, and every container delete is dropped as "stale".
On main the predicate is also used by applyChangesSync (apply.ts:426), so the RPC server path has the same comparison. The same predicate runs on the computerd side for deletes pushed from the DO. It works today only because the DO's revs are larger, and would drop DO deletes if the container's counter were ever ahead.
Repro without a container
Drive a real Workspace over node:sqlite against a fake SyncRPC/ShellRPC peer whose counter starts at 1:
- Write
/workspace/xa few times so the local rev is well above the peer's. - Make the fake command append
{ kind: 'delete', path: '/workspace/x', rev: <peer rev> }to the peer's change log. - Run
ws.runtime.exec(..., { backend }).
Result: pulled === 0 and /workspace/x still exists.
Workaround we are running
One possible fix, which we applied as a local patch to dist/index.js: decide staleness by whether the peer has seen the local version. A node pushed to this backend (rev <= pushRev) yields to the peer's delete; a local change newer than the last completed push still wins.
function tombstoneIsStale(db, entry, backend) {
const live = resolveInode(db, entry.path, { followSymlinks: false });
if (live === null) return false;
const row = db.one("SELECT rev FROM vfs_nodes WHERE inode = ?", live.inode);
if (row === void 0) return false;
return row.rev > readWatermark(db, "pushRev", backend ?? DEFAULT_BACKEND_ID);
}
// call site in applyChanges: tombstoneIsStale(db, entry, options.backend)
After a watermark divergence (pullOnceImpl resets pushRev to 0), deletes stay conservatively dropped until the next push re-establishes the watermark. We are not sure this is the right fix for the computerd side, or for pack pulls, but the cross-space comparison looks unintended.
- Ngôn ngữ chính
- TypeScript
- Star
- 9.5k
- Fork
- 552
- Merge trung bình
- 1 ngày 17 giờ
- Pull request đã merge (30 ngày)
- 50
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của cloudflare/computer
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
cloudflare/computer#224 · 5 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Always run the "next" computerd workflow on push to the `release` branchCó thể đã có người làm @aron-cf đã nhận 4 ngày trước. Đang mởbug
cloudflare/computer#222 · 2 bình luận · 1 reaction · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Make just-bash and acorn optional peer dependencies, pulled in only by the backend that needs themĐang mởenhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
cloudflare/computer#220 · 3 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Workspace namespaces: more than one Workspace per Durable Object storageCó thể đã có người làm @aron-cf đã nhận 4 ngày trước. Đang mởenhancement
cloudflare/computer#219 · 1 bình luận · 1 reaction · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
git: host-held credentials for model-driven clone, fetch, pull and pushCó thể đã có người làm @aron-cf đã nhận 4 ngày trước. Đang mởenhancement
cloudflare/computer#218 · 3 bình luận · 1 reaction · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của cloudflare/computer
Issue tương tự
-
Documentation Link TypoĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 83/100
Zettlr/Zettlr#6610 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Feil lovtekst i bekreftelsen når leder melder unntak fra oppfølgingsplanCó thể đã có người làm @AudunSorheim đã nhận hôm nay. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
navikt/syfo-oppfolgingsplan-frontend#1110 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
db-ux-design-system/core-web#8461 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Cannot run an integration on windows when power shell is selected as the default profile terminalĐang mởPriority/Blocker Type/Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
wso2/product-integrator#2767 ·
Maintainer thường phản hồi trong vòng 1 ngày