Commit ed4eebb
Fix the deadlock during statements gossiping (#9868)
# Description
During statement store benchmarking we experienced deadlock-like
behavior which we found happened during statement propagation. Every
second statements were propagating, locking the index which possibly
caused the deadlock. After the fix, the observed behavior no longer
occurs.
Even though there is a possibility to unsync the DB and the index for
read operations and release locks earlier, which should be harmless, it
leads to regressions. I suspect because of concurrent access to many
calls of db.get(). Checked with the benchmarks in
#9884
## Integration
This PR should not affect downstream projects.
---------
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>1 parent 2732b6a commit ed4eebb
File tree
2 files changed
+21
-13
lines changed- prdoc
- substrate/client/statement-store/src
2 files changed
+21
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
488 | 488 | | |
489 | 489 | | |
490 | 490 | | |
491 | | - | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | | - | |
| 491 | + | |
497 | 492 | | |
498 | 493 | | |
499 | 494 | | |
| |||
671 | 666 | | |
672 | 667 | | |
673 | 668 | | |
674 | | - | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
675 | 674 | | |
676 | 675 | | |
677 | | - | |
| 676 | + | |
678 | 677 | | |
679 | 678 | | |
680 | 679 | | |
681 | | - | |
| 680 | + | |
682 | 681 | | |
683 | 682 | | |
684 | 683 | | |
685 | 684 | | |
686 | | - | |
687 | | - | |
688 | | - | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
689 | 688 | | |
690 | 689 | | |
691 | 690 | | |
| |||
764 | 763 | | |
765 | 764 | | |
766 | 765 | | |
767 | | - | |
| 766 | + | |
768 | 767 | | |
769 | 768 | | |
770 | 769 | | |
| |||
0 commit comments