Commit 8dfa964
committed
fixup! Implement tiered storage
Here we serialize per-key writes in TierStore to prevent out-of-order
backup updates. Without serialization, concurrent writes to the same key
can interleave across the primary and backup stores (e.g. [w1.primary] →
[w2.primary] → [w2.backup] → [w1.backup]), leaving the backup with stale data.
By adding a per-key TokioMutex that serializes write and remove operations
for a given (namespace, key) tuple, we ensure both the primary and backup
stores reflect the same final value. The lock map is cleaned up after
each operation when no other in-flight operations hold a reference,
following the same pattern used in VssStore.1 parent 15c5cf3 commit 8dfa964
1 file changed
Lines changed: 67 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
| 144 | + | |
143 | 145 | | |
144 | 146 | | |
145 | 147 | | |
146 | 148 | | |
147 | 149 | | |
148 | 150 | | |
149 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
150 | 182 | | |
151 | 183 | | |
152 | 184 | | |
| |||
317 | 349 | | |
318 | 350 | | |
319 | 351 | | |
320 | | - | |
| 352 | + | |
321 | 353 | | |
322 | 354 | | |
323 | 355 | | |
324 | | - | |
325 | | - | |
326 | | - | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
327 | 372 | | |
328 | 373 | | |
329 | 374 | | |
| |||
349 | 394 | | |
350 | 395 | | |
351 | 396 | | |
352 | | - | |
| 397 | + | |
353 | 398 | | |
354 | 399 | | |
355 | 400 | | |
356 | | - | |
357 | | - | |
358 | | - | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
359 | 417 | | |
360 | 418 | | |
361 | 419 | | |
| |||
0 commit comments