Commit c7d9ee0
committed
Use GetLatestSnapshot() over GetActiveSnapshot()
We already do serialization properly via `LockTableForUpdate` on
modify vs vacuum, that part is fine.
The problem is that when the waiting transaction is unblocked, it
cannot really see the catalog changes done by the others, unless
the snapshot is `GetLatestSnapshot()`
And, in VACUUM & all other places, we already do that properly:
https://github.com/Snowflake-Labs/pg_lake/blob/bfa38cef35eea16aade99f2557fab7c923a9f9c9/pg_lake_table/src/fdw/writable_table.c#L692-L696
So, we should do that for table scan as well, and this PR is
about that.
Essentially, we get to Iceberg catalog operations follow a global order defined by
`LockTableForUpdate()` within that order, each 'catalog op' sees all committed
changes from earlier `catalog ops`.
We also use the same snapshot for all tables in a scan.1 parent bfa38ce commit c7d9ee0
1 file changed
+13
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| |||
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
84 | 92 | | |
85 | 93 | | |
86 | 94 | | |
| |||
116 | 124 | | |
117 | 125 | | |
118 | 126 | | |
119 | | - | |
| 127 | + | |
| 128 | + | |
120 | 129 | | |
121 | 130 | | |
122 | 131 | | |
| |||
174 | 183 | | |
175 | 184 | | |
176 | 185 | | |
177 | | - | |
| 186 | + | |
178 | 187 | | |
179 | 188 | | |
180 | 189 | | |
| |||
187 | 196 | | |
188 | 197 | | |
189 | 198 | | |
190 | | - | |
191 | 199 | | |
192 | 200 | | |
193 | 201 | | |
| |||
317 | 325 | | |
318 | 326 | | |
319 | 327 | | |
320 | | - | |
| 328 | + | |
| 329 | + | |
321 | 330 | | |
322 | 331 | | |
323 | 332 | | |
| |||
0 commit comments