You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Progressive scope publication can make concurrent retrieval return HTTP 409 #522
A progressive PDF search returned HTTP 409 with “Document search changed during retrieval. Please retry.” Two overlapping production requests failed after approximately 84 s and 50 s. Each first attempt spent about 30 s in a SELECT ... FOR UPDATE OF job_results that hit the statement timeout.
The following trace timeline is relative to the first request. The two publications were traced to different documents in the same namespace.
Offset
Event
+0 s
Request A captures the namespace generation
+34 s
Request B captures the namespace generation
+53 s
Worker publishes refined scope A and updates the namespace generation
+54 s and +74 s
Requests A and B detect a generation change and capture new pins for their one retry
+81 s
Worker publishes refined scope B and updates the same generation again
+84 s and +85 s
The retried requests detect the second change and return 409
Cause
The retrieval plan retries once when the namespace generation changes. The scope publisher rewrites serving content and advances that generation for each scope. The diff for #484 removed the deferred publication path from the earlier implementation. The wire contract still describes staging intermediate results and publishing once.
The read-time enqueue helper locks candidate result rows before filtering for the chunk parse track. The traces show the timeout followed by failed writes in the aborted transaction. The successful generation reads then detect the separate publication conflicts.
Acceptance criteria
Intermediate scope completion does not alter serving rows or the namespace generation for new progressive revisions. Final publication atomically switches content and indexes and retains correct page and embedded asset references.
Retrieval remains responsive when a worker holds a job-result row lock. Enqueue or priority-promotion failure cannot abort the retrieval transaction.
A concurrency regression test covers two other documents refining scopes in one namespace while a query is in flight. The result cites one coherent snapshot.
Activity