Commit 9a5827d
committed
MB-35607: Correct HCS flushing logic
Currently the HCS flushing logic is flawed in two ways:
1) If we disconnect and reconnect a stream then flush a disk
snapshot the HCS may be weakly monotonic (if the active node moves
on and streams to the replica from disk without doing any other
SyncWrites).
2) getItemsForCursor is returning a HCS value before the checkpoint
end. This is incorrect as we can flush partial disk snapshots and a
subsequent warmup may bring the node back in a bad state (missing
prepares). This should work fine if the rest of the disk snapshot is
streamed, but if this node is promoted beforehand and streams from
memory to a replica then the replica will start firing assertions.
This is a dataloss situation already, but undesirable nonetheless.
Change-Id: I700e25d248968ce01abd68236a61fe3a960b11a5
Reviewed-on: http://review.couchbase.org/113552
Reviewed-by: Dave Rigby <[email protected]>
Tested-by: Build Bot <[email protected]>1 parent a211154 commit 9a5827d
File tree
7 files changed
+73
-18
lines changed- engines/ep
- src
- tests/module_tests
7 files changed
+73
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
385 | 386 | | |
386 | 387 | | |
387 | 388 | | |
388 | | - | |
389 | | - | |
| 389 | + | |
| 390 | + | |
390 | 391 | | |
391 | 392 | | |
392 | 393 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
525 | 525 | | |
526 | 526 | | |
527 | 527 | | |
528 | | - | |
| 528 | + | |
529 | 529 | | |
530 | 530 | | |
531 | 531 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
855 | 855 | | |
856 | 856 | | |
857 | 857 | | |
858 | | - | |
859 | 858 | | |
860 | 859 | | |
861 | 860 | | |
| |||
875 | 874 | | |
876 | 875 | | |
877 | 876 | | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
878 | 882 | | |
879 | 883 | | |
880 | 884 | | |
881 | 885 | | |
882 | 886 | | |
883 | 887 | | |
884 | 888 | | |
885 | | - | |
886 | | - | |
887 | | - | |
888 | | - | |
889 | | - | |
890 | 889 | | |
891 | 890 | | |
892 | 891 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
63 | | - | |
| 62 | + | |
| 63 | + | |
64 | 64 | | |
65 | | - | |
66 | | - | |
| 65 | + | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
70 | 71 | | |
71 | | - | |
| 72 | + | |
| 73 | + | |
72 | 74 | | |
73 | | - | |
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
417 | 417 | | |
418 | 418 | | |
419 | 419 | | |
420 | | - | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
421 | 430 | | |
422 | 431 | | |
423 | 432 | | |
| |||
Lines changed: 39 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
985 | 985 | | |
986 | 986 | | |
987 | 987 | | |
988 | | - | |
| 988 | + | |
989 | 989 | | |
990 | 990 | | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
991 | 1007 | | |
992 | 1008 | | |
993 | 1009 | | |
| |||
1009 | 1025 | | |
1010 | 1026 | | |
1011 | 1027 | | |
| 1028 | + | |
1012 | 1029 | | |
1013 | 1030 | | |
1014 | 1031 | | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
1015 | 1053 | | |
1016 | 1054 | | |
1017 | 1055 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
159 | 166 | | |
160 | 167 | | |
161 | 168 | | |
| |||
0 commit comments