Repository navigation
Conversation
The cluster_setup page only described a single asynchronous standby: a replication user, wal_level=replica, pg_basebackup -R, and a raw pg_stat_replication dump. Nothing covered synchronous replication, how to promote a standby, what has to be cleaned up afterwards, or how the Oracle-compatible listener behaves on a standby. Add four sections to the CN and EN pages: - synchronous replication: both synchronous_standby_names notations, what they turn sync_state into (sync vs quorum), and the lag columns; - promotion drill: pg_ctl promote / pg_promote(), the read-only check, the split-brain check, and pg_rewind to re-attach the old primary; - per-node ivorysql.port consistency: the same instance answers with compatible_mode=pg or oracle depending on which listener the client reaches, so a standby that only sets port either fails to bind the Oracle socket or serves the wrong semantics; - replication monitoring: sync_priority, sync_state, and the lag columns. The promotion section documents the trap that costs the most time: a standby built with pg_basebackup -R inherits synchronous_standby_names, so right after promotion every commit waits in wait_event_type=IPC, wait_event=SyncRep and statement_timeout does not interrupt it. Clearing the parameter needs two separate statements because ALTER SYSTEM cannot run inside the same transaction as the reload.
|
🚀 IvorySQL-Docs Preview Ready
|
Author
|
CI is green and the rendered result has been verified on the deploy preview.
Nothing else is pending on my side -- happy to adjust wording or split anything if you prefer a different shape for this section. |
qwer381
force-pushed
the
docs/cluster-sync-replication
branch
from
November 13, 2026 05:53
c216b1e to
4c8affa
Compare
|
🚀 IvorySQL-Docs Preview Ready
|
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #384
What this changes
CN|EN/modules/ROOT/pages/master/cluster_setup.adocgains four sections after the existing "Using the cluster" chapter. The existing text is untouched — the CN page is+191 −0and the EN page is+192 −1; the single deletion is the missing end-of-file newline (the EN page ends with a code fence that has no line terminator, so appending a section requires adding one, otherwise the new==heading is glued to the fence and the section renders broken).== 同步复制/== Synchronous replication—synchronous_standby_nameswith both notations, and what each one does topg_stat_replication.sync_state(syncvsquorum), plus the lag columns.== 主备切换演练/== Promotion drill—pg_ctl promoteandSELECT pg_promote(wait => true, wait_seconds => 60), the read-only check before promotion, the split-brain check afterwards (pg_is_in_recovery(),pg_stat_replication, slot activity) andpg_rewindto bring the old primary back.== Oracle 兼容端口在主备上的一致性/== Keeping ivorysql.port consistent across nodes— the Oracle-compatible listener is a socket per node: connecting on 5533 givescompatible_mode = pg, connecting on 1621 givesoracleon the same instance. A standby that only changesporteither collides with whatever owns 1521 (FATAL: could not create any Oracle TCP/IP sockets) or serves Oracle semantics on the wrong port.== 复制状态监控/== Monitoring replication— how to readwrite_lag/flush_lag/replay_lag,sync_priority,sync_state, and what "no rows inpg_stat_replication" means on the new primary.The promotion section also documents the trap that costs the most time in practice: a standby built with
pg_basebackup -Rinheritssynchronous_standby_names, so right after promotion — with no standby attached — every commit waits inwait_event_type = IPC / wait_event = SyncRepandstatement_timeout = '8s'does not interrupt it. The fix is two separate statements, because a single-cwith a semicolon fails withERROR: ALTER SYSTEM cannot run inside a transaction block:How it was verified
Everything quoted in the patch was produced on IvorySQL 5.6 (
PostgreSQL 18.6 (IvorySQL 5.6)), one primary + one standby on the same host,port5532/5533 andivorysql.port1621/1622; the rawpsqland log transcripts were kept as evidence.pg_rewindis the only command shown with placeholders (<old_primary_data_dir>,<new_primary_ip>) — it is not re-run in this patch, and the text says the old primary must be stopped first.Rendering: both files convert with
asciidoctor.js 4.2.1with zero warnings, and the section structure is symmetric between CN and EN.Checklist
cluster_setup.adoc(CN + EN) touched, nonav.adocchange