File tree Expand file tree Collapse file tree
internal-packages/run-engine/src/engine Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ) ) ;
You can’t perform that action at this time.
0 commit comments