[Bug] Mirrors crash during WAL replay when wal_compression is pglz/lz4
Maintainer antworten meist innerhalb von 2 Tagen
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- Ein halber Tag
- Anfängerfreundlichkeit
- 58/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Bereich
- databases, distributed-systems
Rechercherichtung
Start in RestoreBlockImage() in src/backend/access/transam/xlogreader.c (around line 2096), where zstd_decompress_backupblock() runs before the bimg_info method check. Compare it with XLogCompressBackupBlock() on the write side to see which methods write images. Done when pglz and lz4 images replay without error; reproduce with the SQL in the issue on a cluster with mirrors.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Apache Cloudberry version
No response
What happened
Reproduce (on a cluster with mirrors):
CREATE TABLE w (a int, b text) DISTRIBUTED BY (a);
INSERT INTO w SELECT i, repeat('x', 100) FROM generate_series(1, 1000) i;
CHECKPOINT;
SET wal_compression = pglz;
UPDATE w SET b = 'y' WHERE a < 100;
Actual: the UPDATE succeeds, but all segment mirrors stop WAL replay and shut down, and FTS marks them down:
FATAL: invalid compressed image at 0/C7CFF070, block 0 (error computing decompression size)
LOG: startup process (PID ...) exited with exit code 1
LOG: shutting down due to startup process failure
gprecoverseg (incremental) reports success, but the mirrors replay the same WAL record and crash again. Only gprecoverseg -F (full recovery) brings them back.
Expected: the mirrors replay the WAL normally, as they do with SET wal_compression = zstd. With zstd, the same steps produce no errors.
Cause: in RestoreBlockImage() (src/backend/access/transam/xlogreader.c, around line 2096), every compressed page image is passed to zstd_decompress_backupblock() before the code checks bimg_info for the method
actually used. That zstd-only call dates from commit 60915ec6b2e ("Use zstd for wal_compression", 2020), when Greenplum always compressed WAL with zstd. Since the merges from PostgreSQL,
XLogCompressBackupBlock() writes images with the method chosen by wal_compression (pglz, lz4 or zstd), so pglz and lz4 images reach the zstd decoder and fail. A likely fix is to remove the unconditional zstd
call and rely on the per-method code that follows it.
Impact:
- A session-level SET wal_compression plus an ordinary write is enough. It leaves the cluster without mirror protection until an administrator runs a full recovery.
- Not verified: lz4 (expected to fail the same way, since the same code runs first), and whether a primary's own crash recovery also fails after replaying such a record.
What you think should happen instead
No response
How to reproduce
Reproduce (on a cluster with mirrors):
CREATE TABLE w (a int, b text) DISTRIBUTED BY (a);
INSERT INTO w SELECT i, repeat('x', 100) FROM generate_series(1, 1000) i;
CHECKPOINT;
SET wal_compression = pglz;
UPDATE w SET b = 'y' WHERE a < 100;
Operating System
any
Anything else
No response
Are you willing to submit PR?
- Yes, I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct.
- Vorherrschende Sprache
- C
- Sterne
- 1.4k
- Forks
- 265
- Ø Merge
- 3 T. 12 Std.
- Gemergte PRs (30 T.)
- 60
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus apache/cloudberry
-
[Bug] Expand fails to recognize user-defined tablespacesEvtl. vergeben @nix-oss hat das vor 67 Tagen übernommen. Offentype: Bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
apache/cloudberry#1885 · 2 Reaktionen ·
Maintainer antworten meist innerhalb von 2 Tagen
-
gpexpand first stage fails: 'SyncPackages' object has no attribute 'ret' (extension sync never runs; regression)Evtl. vergeben @talmacschen-arch hat das vor 129 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
apache/cloudberry#1825 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
[Bug] PL/Python statement_timeout can leave a zombie subprocess despite finally: wait()Evtl. vergeben @krylosov-aa hat das heute übernommen. Offentype: Bug
apache/cloudberry#2181 · 2 Kommentare · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
apache/cloudberry#2174 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
apache/cloudberry#2173 ·
Maintainer antworten meist innerhalb von 2 Tagen
Alle Issues in apache/cloudberry
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
-
area:ci priority:low type:chore
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
crazy-goat/php-fpm-ng#1021 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
CCExtractor/ccextractor#2425 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
pawelsalawa/letos#5839 ·