Commit 5928881
committed
ct/l1/lsm: avoid segfault after opening fails
There was previously the following race:
A: calls gate_and_open_reads(); finishes maybe_open_db() and then waits
for database lock
-: leadership changes
B: calls gate_and_open_reads(); maybe_open_db() tries to reopen database
with the database lock
B: closes database and resets the pointer, and for some reason (e.g.
another leadership change) fails to sync, returning an error without
setting db_
A: acquires the database lock and dereferences the null database
This commit fixes this by updating calls to maybe_open_db() to check the
db before dereferencing.1 parent 545b890 commit 5928881
File tree
2 files changed
+11
-4
lines changed- src/v/cloud_topics/level_one/domain
2 files changed
+11
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
903 | 903 | | |
904 | 904 | | |
905 | 905 | | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
906 | 909 | | |
907 | 910 | | |
908 | 911 | | |
| |||
1087 | 1090 | | |
1088 | 1091 | | |
1089 | 1092 | | |
1090 | | - | |
| 1093 | + | |
1091 | 1094 | | |
1092 | 1095 | | |
1093 | 1096 | | |
| |||
1101 | 1104 | | |
1102 | 1105 | | |
1103 | 1106 | | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
1104 | 1112 | | |
1105 | 1113 | | |
1106 | 1114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
91 | | - | |
92 | | - | |
| 90 | + | |
| 91 | + | |
93 | 92 | | |
94 | 93 | | |
95 | 94 | | |
| |||
0 commit comments