Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork1.7k
Commita7e89d1
committed
Make stream snapshots asynchronous
The monitorStream function can block for a long time when creating andinstalling a snapshot of a stream's state. This can lead to increasedtail latency.This commit extends the RaftNode interface with a new InstallSnapshotAsyncmethod. This method performs snapshot writing and WAL compaction in ain a separate goroutine, making the process non-blocking. The existingInstallSnapshot method is now a synchronous wrapper around the newasynchronous implementation.Signed-off-by: Daniele Sciascia <daniele@nats.io>1 parente2661b5 commita7e89d1
2 files changed
+145
-33
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2519 | 2519 | | |
2520 | 2520 | | |
2521 | 2521 | | |
2522 | | - | |
| 2522 | + | |
| 2523 | + | |
| 2524 | + | |
| 2525 | + | |
| 2526 | + | |
| 2527 | + | |
| 2528 | + | |
| 2529 | + | |
| 2530 | + | |
2523 | 2531 | | |
2524 | | - | |
| 2532 | + | |
| 2533 | + | |
| 2534 | + | |
| 2535 | + | |
| 2536 | + | |
2525 | 2537 | | |
2526 | 2538 | | |
2527 | 2539 | | |
| |||
2534 | 2546 | | |
2535 | 2547 | | |
2536 | 2548 | | |
2537 | | - | |
| 2549 | + | |
| 2550 | + | |
| 2551 | + | |
| 2552 | + | |
| 2553 | + | |
| 2554 | + | |
| 2555 | + | |
| 2556 | + | |
| 2557 | + | |
| 2558 | + | |
| 2559 | + | |
| 2560 | + | |
| 2561 | + | |
| 2562 | + | |
| 2563 | + | |
| 2564 | + | |
| 2565 | + | |
| 2566 | + | |
| 2567 | + | |
| 2568 | + | |
| 2569 | + | |
| 2570 | + | |
| 2571 | + | |
| 2572 | + | |
| 2573 | + | |
| 2574 | + | |
2538 | 2575 | | |
| 2576 | + | |
2539 | 2577 | | |
2540 | | - | |
2541 | | - | |
2542 | | - | |
2543 | | - | |
2544 | | - | |
2545 | | - | |
| 2578 | + | |
| 2579 | + | |
| 2580 | + | |
| 2581 | + | |
| 2582 | + | |
| 2583 | + | |
2546 | 2584 | | |
2547 | 2585 | | |
2548 | 2586 | | |
| 2587 | + | |
| 2588 | + | |
| 2589 | + | |
| 2590 | + | |
| 2591 | + | |
| 2592 | + | |
| 2593 | + | |
| 2594 | + | |
| 2595 | + | |
| 2596 | + | |
| 2597 | + | |
| 2598 | + | |
2549 | 2599 | | |
2550 | 2600 | | |
2551 | 2601 | | |
| |||
2617 | 2667 | | |
2618 | 2668 | | |
2619 | 2669 | | |
| 2670 | + | |
| 2671 | + | |
2620 | 2672 | | |
2621 | 2673 | | |
2622 | 2674 | | |
| |||
2726 | 2778 | | |
2727 | 2779 | | |
2728 | 2780 | | |
2729 | | - | |
| 2781 | + | |
2730 | 2782 | | |
2731 | 2783 | | |
2732 | 2784 | | |
| |||
2822 | 2874 | | |
2823 | 2875 | | |
2824 | 2876 | | |
2825 | | - | |
| 2877 | + | |
2826 | 2878 | | |
2827 | 2879 | | |
2828 | 2880 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
230 | 231 | | |
231 | 232 | | |
232 | 233 | | |
| 234 | + | |
233 | 235 | | |
234 | 236 | | |
235 | 237 | | |
| |||
307 | 309 | | |
308 | 310 | | |
309 | 311 | | |
| 312 | + | |
310 | 313 | | |
311 | 314 | | |
312 | 315 | | |
| |||
1242 | 1245 | | |
1243 | 1246 | | |
1244 | 1247 | | |
1245 | | - | |
1246 | | - | |
1247 | | - | |
1248 | | - | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
1249 | 1290 | | |
1250 | | - | |
| 1291 | + | |
| 1292 | + | |
1251 | 1293 | | |
1252 | 1294 | | |
1253 | 1295 | | |
1254 | 1296 | | |
1255 | 1297 | | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
1256 | 1303 | | |
1257 | | - | |
1258 | | - | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
1259 | 1307 | | |
1260 | 1308 | | |
1261 | | - | |
1262 | | - | |
| 1309 | + | |
| 1310 | + | |
1263 | 1311 | | |
1264 | | - | |
| 1312 | + | |
| 1313 | + | |
1265 | 1314 | | |
1266 | 1315 | | |
1267 | 1316 | | |
1268 | | - | |
1269 | | - | |
| 1317 | + | |
| 1318 | + | |
1270 | 1319 | | |
1271 | 1320 | | |
1272 | | - | |
1273 | | - | |
1274 | | - | |
1275 | | - | |
1276 | | - | |
1277 | | - | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
1278 | 1325 | | |
1279 | 1326 | | |
1280 | | - | |
1281 | | - | |
1282 | | - | |
1283 | | - | |
| 1327 | + | |
| 1328 | + | |
1284 | 1329 | | |
1285 | 1330 | | |
1286 | 1331 | | |
1287 | 1332 | | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
1288 | 1348 | | |
1289 | 1349 | | |
1290 | 1350 | | |
| |||
0 commit comments
Comments
(0)