Commit 09f8a2f
authored
Start AOFRW before streaming repl buffer during fullsync (redis#13758)
During fullsync, before loading RDB on the replica, we stop aof child to
prevent copy-on-write disaster.
Once rdb is loaded, aof is started again and it will trigger aof
rewrite. With redis#13732 , for rdbchannel
replication, this behavior was changed. Currently, we start aof after
replication buffer is streamed to db. This PR changes it back to start
aof just after rdb is loaded (before repl buffer is streamed)
Both approaches may have pros and cons. If we start aof before streaming
repl buffers, we may still face with copy-on-write issues as repl
buffers potentially include large amount of changes. If we wait until
replication buffer drained, it means we are delaying starting aof
persistence.
Additional changes are introduced as part of this PR:
- Interface change:
Added `mem_replica_full_sync_buffer` field to the `INFO MEMORY` command
reply. During full sync, it shows total memory consumed by accumulated
replication stream buffer on replica. Added same metric to `MEMORY
STATS` command reply as `replica.fullsync.buffer` field.
- Fixes:
- Count repl stream buffer size of replica as part of 'memory overhead'
calculation for fields in "INFO MEMORY" and "MEMORY STATS" outputs.
Before this PR, repl buffer was not counted as part of memory overhead
calculation, causing misreports for fields like `used_memory_overhead`
and `used_memory_dataset` in "INFO STATS" and for `overhead.total` field
in "MEMORY STATS" command reply.
- Dismiss replication stream buffers memory of replica in the fork to
reduce COW impact during a fork.
- Fixed a few time sensitive flaky tests, deleted a noop statement,
fixed some comments and fail messages in rdbchannel tests.1 parent 870b6bd commit 09f8a2f
File tree
6 files changed
+52
-18
lines changed- src
- commands
- tests/integration
6 files changed
+52
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1209 | 1209 | | |
1210 | 1210 | | |
1211 | 1211 | | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
1212 | 1215 | | |
1213 | 1216 | | |
1214 | 1217 | | |
| |||
1560 | 1563 | | |
1561 | 1564 | | |
1562 | 1565 | | |
1563 | | - | |
| 1566 | + | |
1564 | 1567 | | |
1565 | 1568 | | |
1566 | 1569 | | |
| |||
1574 | 1577 | | |
1575 | 1578 | | |
1576 | 1579 | | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
1577 | 1583 | | |
1578 | 1584 | | |
1579 | 1585 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2444 | 2444 | | |
2445 | 2445 | | |
2446 | 2446 | | |
| 2447 | + | |
| 2448 | + | |
| 2449 | + | |
| 2450 | + | |
| 2451 | + | |
| 2452 | + | |
| 2453 | + | |
| 2454 | + | |
2447 | 2455 | | |
2448 | 2456 | | |
2449 | 2457 | | |
| |||
2465 | 2473 | | |
2466 | 2474 | | |
2467 | 2475 | | |
2468 | | - | |
2469 | | - | |
2470 | | - | |
2471 | | - | |
2472 | | - | |
2473 | | - | |
2474 | | - | |
2475 | 2476 | | |
2476 | 2477 | | |
2477 | 2478 | | |
| |||
3671 | 3672 | | |
3672 | 3673 | | |
3673 | 3674 | | |
| 3675 | + | |
3674 | 3676 | | |
3675 | 3677 | | |
3676 | 3678 | | |
| |||
3682 | 3684 | | |
3683 | 3685 | | |
3684 | 3686 | | |
| 3687 | + | |
3685 | 3688 | | |
3686 | 3689 | | |
3687 | 3690 | | |
| |||
3752 | 3755 | | |
3753 | 3756 | | |
3754 | 3757 | | |
| 3758 | + | |
3755 | 3759 | | |
3756 | 3760 | | |
3757 | 3761 | | |
| |||
3791 | 3795 | | |
3792 | 3796 | | |
3793 | 3797 | | |
3794 | | - | |
| 3798 | + | |
| 3799 | + | |
3795 | 3800 | | |
3796 | 3801 | | |
3797 | 3802 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5818 | 5818 | | |
5819 | 5819 | | |
5820 | 5820 | | |
| 5821 | + | |
5821 | 5822 | | |
5822 | 5823 | | |
5823 | 5824 | | |
| |||
6793 | 6794 | | |
6794 | 6795 | | |
6795 | 6796 | | |
| 6797 | + | |
| 6798 | + | |
| 6799 | + | |
| 6800 | + | |
| 6801 | + | |
| 6802 | + | |
| 6803 | + | |
| 6804 | + | |
| 6805 | + | |
6796 | 6806 | | |
6797 | 6807 | | |
6798 | 6808 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1200 | 1200 | | |
1201 | 1201 | | |
1202 | 1202 | | |
| 1203 | + | |
1203 | 1204 | | |
1204 | 1205 | | |
1205 | 1206 | | |
| |||
1498 | 1499 | | |
1499 | 1500 | | |
1500 | 1501 | | |
| 1502 | + | |
1501 | 1503 | | |
1502 | 1504 | | |
1503 | 1505 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
| |||
87 | 88 | | |
88 | 89 | | |
89 | 90 | | |
90 | | - | |
91 | | - | |
92 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
93 | 95 | | |
94 | 96 | | |
95 | 97 | | |
| |||
396 | 398 | | |
397 | 399 | | |
398 | 400 | | |
399 | | - | |
| 401 | + | |
400 | 402 | | |
401 | 403 | | |
402 | | - | |
| 404 | + | |
403 | 405 | | |
404 | 406 | | |
405 | 407 | | |
| |||
465 | 467 | | |
466 | 468 | | |
467 | 469 | | |
468 | | - | |
| 470 | + | |
469 | 471 | | |
470 | 472 | | |
471 | 473 | | |
472 | | - | |
473 | | - | |
| 474 | + | |
474 | 475 | | |
475 | 476 | | |
476 | 477 | | |
| |||
488 | 489 | | |
489 | 490 | | |
490 | 491 | | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
491 | 500 | | |
492 | 501 | | |
493 | 502 | | |
| |||
773 | 782 | | |
774 | 783 | | |
775 | 784 | | |
776 | | - | |
777 | 785 | | |
778 | 786 | | |
779 | 787 | | |
| |||
0 commit comments