Upstream deletes from the container are dropped as stale: tombstoneIsStale compares revs from different peers' rev spaces
メンテナーはふだん 1 日以内に返信
@aron-cf がすでに取り組んでいます。
2026年9月29日 から。
評価
この issue はまだ評価されていません。
説明
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.
- 主要言語
- TypeScript
- スター
- 9.5k
- フォーク
- 552
- 平均マージ
- 2日 6時間
- マージ済み PR(30日)
- 47
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
cloudflare/computer のほかの issue
-
Sync planning scans the full pending change set before yielding; repeated Durable Object CPU-limit failures対応中かも @aron-cf が 1 日前に担当しました。 オープンbug
cloudflare/computer#225 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
cloudflare/computer#224 · コメント 5 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Always run the "next" computerd workflow on push to the `release` branch対応中かも @aron-cf が 2 日前に担当しました。 オープンbug
cloudflare/computer#222 · コメント 2 件 · リアクション 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Make just-bash and acorn optional peer dependencies, pulled in only by the backend that needs themオープンenhancement
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
cloudflare/computer#220 · コメント 3 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Workspace namespaces: more than one Workspace per Durable Object storage対応中かも @aron-cf が 2 日前に担当しました。 オープンenhancement
cloudflare/computer#219 · コメント 1 件 · リアクション 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
cloudflare/computer の issue をすべて見る
似ている issue
-
by: ai-assisted frontend good-for: new-member spike
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Northeastern-Electric-Racing/Argos#847 ·
メンテナーはふだん 4 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 84/100
SignalK/freeboard-sk#990 ·
メンテナーはふだん 1 日以内に返信
-
[missing-inheritance] audit review (1 preset)対応中かも @github-actions が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
osmberlin/tagging-schema-browser#363 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Albert-Weasker/niubigeo#205 ·
メンテナーはふだん 1 日以内に返信
-
area/frontend area/v2 kind/bug priority/needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
kubeflow/notebooks#1498 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信