Skip to content

Commit d91bce4

Browse files
committed
test(server): hold the write lock while the read runs, so the overlap is guaranteed
The writer streamed inserts and signalled a milestone part way through, so the read could still start after the writer had finished: the reader's transaction opens with an asynchronous BEGIN, and the writer can use that window to complete its inserts. The test then measured a read with no write load in it. The writer now HOLDS the write lock for the whole read, so the overlap is guaranteed by construction rather than by timing. With the lock held, the two connections behave differently, and the difference is the change: read-on-reader: connection=reader lock_wait_ms=0.022 lock_held_for_ms=12 read-on-writer: outcome=Failure lock_held_for_ms=3002 connections_acquired=0 The read on the reader connection completes while the writer holds the lock. The same read on the writer connection cannot even acquire a connection - it waits for the lock until the bound expires, and there is no db.connection span for it because the acquisition never finished.
1 parent cdfa669 commit d91bce4

1 file changed

Lines changed: 123 additions & 227 deletions

File tree

0 commit comments

Comments
 (0)