Commit 4c402d4
committed
db-sync: Fix a race condition maintaining ledger state
When blocks and rollback notifications arrive via the chainsync protocol,
they are put in a queue and then a separate thread reads from the queue and
operates on the DB. When ledger-state management was added, code to apply a
block to a ledger state was added at the read end of the queue, but the
rollback handling was incorrectly added at the write end of the queue.
The solution to the problem is trivial, move the ledger state rollback
handling from the write end of the queue to the read end.
Closes: https://github.com/input-output-hk/cardano-db-sync/issue/3981 parent 8f7a5cc commit 4c402d4
2 files changed
+6
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
240 | | - | |
| 240 | + | |
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
| |||
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
320 | | - | |
| 320 | + | |
321 | 321 | | |
322 | | - | |
| 322 | + | |
323 | 323 | | |
324 | 324 | | |
325 | 325 | | |
| |||
373 | 373 | | |
374 | 374 | | |
375 | 375 | | |
376 | | - | |
377 | 376 | | |
378 | 377 | | |
379 | 378 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
97 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
98 | 99 | | |
99 | 100 | | |
100 | 101 | | |
| |||
0 commit comments