Commit 6c361b9
committed
sql: force PCR reader catalogs to use a fixed timestamp
Previously, the original logic for advancing the PCR reader catalog
timestamp ran into the risk of mixing different timestamps, since the
lease manager relies on range feeds. So, it was possible for a single
txn to observe some newer and older descriptors. To address this, this
patch does the following:
1) It introduces an assertion in the leased descriptors to ensure that
all external row data tables have the same timestamp.
2) The connection executor is modified for PCR reader catalog to always
use AOST queries, where the AOST timestamp is determine based on the
range feeds check point. This ensures that all data up to the
timestamp synced up. We detect PCR reader catalog by checking the
the ReplicatedPCRVersion on the systme database, which will be set
during bootstrap.
Fixes: #130812
Release note: None1 parent a50d588 commit 6c361b9
File tree
7 files changed
+351
-19
lines changed- pkg/sql
- catalog
- descs
- lease
- replication
7 files changed
+351
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
79 | 80 | | |
80 | 81 | | |
81 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
82 | 170 | | |
83 | 171 | | |
84 | 172 | | |
| |||
99 | 187 | | |
100 | 188 | | |
101 | 189 | | |
102 | | - | |
| 190 | + | |
| 191 | + | |
103 | 192 | | |
104 | 193 | | |
105 | 194 | | |
| |||
183 | 272 | | |
184 | 273 | | |
185 | 274 | | |
186 | | - | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
187 | 281 | | |
188 | 282 | | |
189 | 283 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
889 | 889 | | |
890 | 890 | | |
891 | 891 | | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
892 | 896 | | |
893 | 897 | | |
894 | 898 | | |
| |||
996 | 1000 | | |
997 | 1001 | | |
998 | 1002 | | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
999 | 1009 | | |
1000 | 1010 | | |
1001 | 1011 | | |
| |||
1438 | 1448 | | |
1439 | 1449 | | |
1440 | 1450 | | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
1441 | 1457 | | |
1442 | 1458 | | |
1443 | 1459 | | |
| |||
1496 | 1512 | | |
1497 | 1513 | | |
1498 | 1514 | | |
| 1515 | + | |
1499 | 1516 | | |
1500 | 1517 | | |
1501 | 1518 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
38 | 40 | | |
| 41 | + | |
39 | 42 | | |
40 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
41 | 47 | | |
| 48 | + | |
42 | 49 | | |
43 | 50 | | |
44 | 51 | | |
0 commit comments