Preserve live-query re-evaluation when writes race _execOverDatabase()#8536
Conversation
…ore signal for eventual consistency Agent-Logs-Url: https://github.com/pubkey/rxdb/sessions/e3b3eb19-a9bb-4a2e-ade7-4a0d97dab92f Co-authored-by: pubkey <8926560+pubkey@users.noreply.github.com>
…rent writes Agent-Logs-Url: https://github.com/pubkey/rxdb/sessions/18b5bac4-27b1-4b4f-a295-1f30c3108f7a Co-authored-by: pubkey <8926560+pubkey@users.noreply.github.com>
|
@copilot what was the problem? I stilil think doing a promiseWait a bit is better to ensure on non-async storages like in-memory we do not full-block the javasciript process. |
The main problem was not event-loop blocking. The bug was that a write could happen while So I think a small |
|
@copilot ok, use promiseWait(20) no mather which rerunCount we have. still keep the rerunCount in place. |
|
Agent-Logs-Url: https://github.com/pubkey/rxdb/sessions/e5ba458c-8692-4a6e-9c4c-fc4c9a0c0251 Co-authored-by: pubkey <8926560+pubkey@users.noreply.github.com>
Done in 810fbd5. |
|
ok works. now remove your test, we do not need that because it is way to complex to maintain or read. @copilot |
Agent-Logs-Url: https://github.com/pubkey/rxdb/sessions/7f3e4920-b04a-47bf-9b2c-a369a840a9ee Co-authored-by: pubkey <8926560+pubkey@users.noreply.github.com>
Removed in 3248972. The extra |
|
add to changelog with link to the issue #8444 |
Agent-Logs-Url: https://github.com/pubkey/rxdb/sessions/e10a28bf-0e68-41a2-ad64-b8fc905af251 Co-authored-by: pubkey <8926560+pubkey@users.noreply.github.com>
|
@copilot changelog is wrong. read the issue again. we just fixed the waiting times |
Agent-Logs-Url: https://github.com/pubkey/rxdb/sessions/698d5cce-d56a-45ec-8dd7-34d782157358 Co-authored-by: pubkey <8926560+pubkey@users.noreply.github.com>
Live queries could stall or miss the required follow-up evaluation when a write committed while
_execOverDatabase()was still reading. The previous retry-with-promiseWait(rerunCount * 20)approach avoided a tight loop, but under sustained writes the growing backoff could keep deferring progress and delay the firstquery.$emission.Problem
_execOverDatabase()could finish with a counter that had already advanced past a concurrent write event.rerunCountcould keep stretching out re-execution under write pressure.Counter handling
ChangeEventBuffercounter before running the storage read.Retry behavior
_execOverDatabase().promiseWait(20)instead ofpromiseWait(rerunCount * 20).Regression coverage
query()and commits a write while the initial query is in flight, verifying thatquery.$still emits the inserted document.