Commit 0f592a0
Antonin Houska
Store the snapshot for the initial load in the correct memory context.
Although the correct context (TopMemoryContext) is set explicitly, it appears
that DecodingContextFindStartpoint() (PG core) can change it to
TopTransactionContext. This can happen if cache invalidations are processed at
certain stage of the setup of the logical decoding system. In practice, cache
invalidations take place when DDL commands are executed.
If the wrong memory context is used, the snapshot for the initial load can get
corrupted, which in turn can cause ERROR (i.e. failure complete the squeezing,
in which case all the work done by the extension gets rolled
back). Unfortunately, at specific circumstances, data loss might probably take
place instead, although I haven't heard about such a case so far.
This bug only affects "manual" processing of tables, i.e. cases where the
squeeze.squeeze_table() function is used. It does not affect cases where the
scheduler worker is involved (shared memory is used then).1 parent 9da6307 commit 0f592a0
1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1560 | 1560 | | |
1561 | 1561 | | |
1562 | 1562 | | |
| 1563 | + | |
| 1564 | + | |
1563 | 1565 | | |
1564 | 1566 | | |
1565 | 1567 | | |
| |||
1588 | 1590 | | |
1589 | 1591 | | |
1590 | 1592 | | |
1591 | | - | |
| 1593 | + | |
| 1594 | + | |
1592 | 1595 | | |
1593 | 1596 | | |
1594 | 1597 | | |
| |||
0 commit comments