Skip to content

Commit 3a5e88b

Browse files
d-csclaude
andcommitted
docs(run-engine): clarify that only not-found replica errors trigger the writer fallback
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 51924bb commit 3a5e88b

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

  • internal-packages/run-engine/src/engine

internal-packages/run-engine/src/engine/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1958,8 +1958,10 @@ export class RunEngine {
19581958
} catch (e) {
19591959
if (useReplica && e instanceof ExecutionSnapshotNotFoundError) {
19601960
// Replica lag: the runner learned this snapshot id from the writer before the
1961-
// replica caught up. Give the replica one jittered retry, then serve from the
1962-
// writer; a miss on the writer too is a real error, not lag.
1961+
// replica caught up. Give the replica one jittered retry; if it's still missing,
1962+
// serve from the writer. Only not-found errors get this treatment - any other
1963+
// replica failure stays an error rather than shifting read load to the writer.
1964+
// A miss on the writer too is a real error, not lag.
19631965
const { minMs, maxMs } = this.snapshotsSinceReplicaRetryDelay;
19641966
if (maxMs > 0) {
19651967
await setTimeout(minMs + Math.random() * Math.max(0, maxMs - minMs));

0 commit comments

Comments
 (0)