Commit 1af97ff
authored
persist: fresh command timestamps during retries (#38060)
Prior to this PR persist commands that accepted a heartbeat timestamp
parameter computed that parameter once and used the same value
throughout all the retries, if any. When the number of retry attempts is
low this is usually not a problem but on heavily utilized clusters
retries can go on for multiple minutes. In the extreme case by the time
the command succeeds, it commits a timestamp that is too stale.
Two instances of this problem were the root cause of incidents 1177 and
1134 were the registration of a read handle was retrying for more than
15 minutes, and by the time it succeeded the handle had already lost its
lease.
This PR removes the heartbeat argument from the affected methods
altogether and instead uses internal fresh calls to persist's `NowFn`
configuration on every retry. By doing this the committed heartbeat
timestamp is only stale by the network latency of the final consensus op
that succeeded.
Signed-off-by: Petros Angelatos <petrosagg@gmail.com>1 parent 72a8db1 commit 1af97ff
4 files changed
Lines changed: 17 additions & 45 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
| 225 | + | |
225 | 226 | | |
226 | 227 | | |
227 | 228 | | |
228 | 229 | | |
229 | 230 | | |
230 | | - | |
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
242 | | - | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
243 | 245 | | |
244 | 246 | | |
245 | 247 | | |
| |||
318 | 320 | | |
319 | 321 | | |
320 | 322 | | |
| 323 | + | |
321 | 324 | | |
322 | 325 | | |
323 | 326 | | |
324 | 327 | | |
325 | 328 | | |
326 | | - | |
327 | 329 | | |
328 | 330 | | |
329 | 331 | | |
330 | 332 | | |
331 | 333 | | |
332 | 334 | | |
333 | 335 | | |
334 | | - | |
335 | 336 | | |
336 | 337 | | |
337 | 338 | | |
| |||
375 | 376 | | |
376 | 377 | | |
377 | 378 | | |
378 | | - | |
379 | 379 | | |
380 | 380 | | |
381 | 381 | | |
| |||
488 | 488 | | |
489 | 489 | | |
490 | 490 | | |
491 | | - | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
492 | 494 | | |
493 | 495 | | |
494 | 496 | | |
| |||
627 | 629 | | |
628 | 630 | | |
629 | 631 | | |
| 632 | + | |
630 | 633 | | |
631 | 634 | | |
632 | 635 | | |
633 | 636 | | |
634 | 637 | | |
635 | | - | |
636 | 638 | | |
637 | 639 | | |
638 | | - | |
639 | | - | |
640 | | - | |
641 | | - | |
642 | | - | |
643 | | - | |
644 | | - | |
645 | | - | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
646 | 644 | | |
647 | 645 | | |
648 | 646 | | |
| |||
1500 | 1498 | | |
1501 | 1499 | | |
1502 | 1500 | | |
1503 | | - | |
1504 | | - | |
1505 | | - | |
1506 | | - | |
1507 | | - | |
1508 | | - | |
| 1501 | + | |
1509 | 1502 | | |
1510 | 1503 | | |
1511 | 1504 | | |
| |||
2195 | 2188 | | |
2196 | 2189 | | |
2197 | 2190 | | |
2198 | | - | |
2199 | 2191 | | |
2200 | 2192 | | |
2201 | 2193 | | |
| |||
2313 | 2305 | | |
2314 | 2306 | | |
2315 | 2307 | | |
2316 | | - | |
2317 | 2308 | | |
2318 | 2309 | | |
2319 | 2310 | | |
| |||
2330 | 2321 | | |
2331 | 2322 | | |
2332 | 2323 | | |
2333 | | - | |
2334 | 2324 | | |
2335 | 2325 | | |
2336 | 2326 | | |
| |||
2494 | 2484 | | |
2495 | 2485 | | |
2496 | 2486 | | |
2497 | | - | |
2498 | 2487 | | |
2499 | 2488 | | |
2500 | 2489 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
360 | | - | |
361 | 360 | | |
362 | 361 | | |
363 | 362 | | |
364 | 363 | | |
365 | 364 | | |
366 | | - | |
367 | 365 | | |
368 | 366 | | |
369 | 367 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
722 | 722 | | |
723 | 723 | | |
724 | 724 | | |
725 | | - | |
726 | 725 | | |
727 | 726 | | |
728 | 727 | | |
| |||
737 | 736 | | |
738 | 737 | | |
739 | 738 | | |
740 | | - | |
| 739 | + | |
741 | 740 | | |
742 | 741 | | |
743 | 742 | | |
| |||
990 | 989 | | |
991 | 990 | | |
992 | 991 | | |
993 | | - | |
994 | 992 | | |
995 | 993 | | |
996 | 994 | | |
997 | 995 | | |
998 | 996 | | |
999 | | - | |
1000 | 997 | | |
1001 | 998 | | |
1002 | 999 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
304 | | - | |
305 | 304 | | |
306 | 305 | | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
| 306 | + | |
313 | 307 | | |
314 | 308 | | |
315 | 309 | | |
| |||
749 | 743 | | |
750 | 744 | | |
751 | 745 | | |
752 | | - | |
753 | 746 | | |
754 | 747 | | |
755 | | - | |
756 | | - | |
757 | | - | |
758 | | - | |
759 | | - | |
760 | | - | |
| 748 | + | |
761 | 749 | | |
762 | 750 | | |
763 | 751 | | |
| |||
0 commit comments