Skip to content

Commit

Permalink
streaming-replication: update diagram
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jul 8, 2024
1 parent d6faa03 commit a411b63
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 22 deletions.
29 changes: 21 additions & 8 deletions _po/ja/reference/streaming-replication.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"PO-Revision-Date: 2024-07-08 11:52+0900\n"
"PO-Revision-Date: 2024-07-08 12:04+0900\n"

msgid ""
"---\n"
Expand Down Expand Up @@ -42,13 +42,26 @@ msgstr "PGroongaのWALは以下のようにスタンバイのサーバーへ送
msgid ""
"```mermaid\n"
"sequenceDiagram\n"
" User->>+PostgreSQL backend:INSERT/UPDATE/DELETE\n"
" PostgreSQL backend->>+Primary Table:INSERT/UPDATE/DELETE\n"
" PostgreSQL backend->>+Primary PGroonga WAL:WAL Write\n"
" PostgreSQL backend->>+WAL Sender:Notify write WAL\n"
" WAL Sender->>+Primary PGroonga WAL:Read WAL\n"
" WAL Sender->>+WAL Reciver:Send WAL\n"
" WAL Reciver->>+Standby PGroonga WAL:Write\n"
" box transparent Primary\n"
" participant Primary user\n"
" participant Primary PGroonga\n"
" participant WAL sender\n"
" end\n"
" box transparent Standby\n"
" participant WAL receiver\n"
" participant Standby user\n"
" participant Standby PGroonga\n"
" end"
msgstr ""

msgid ""
" Primary user->>+Primary PGroonga:INSERT/UPDATE/DELETE\n"
" Note right of Primary PGroonga:Write WAL\n"
" Primary PGroonga->>+WAL sender:Notify write WAL\n"
" WAL sender->>+WAL receiver:Send WAL\n"
" Note right of WAL receiver:Save WAL\n"
" Standby user->>+Standby PGroonga:SELECT\n"
" Note right of Standby PGroonga:Apply saved WAL\n"
"```"
msgstr ""

Expand Down
25 changes: 18 additions & 7 deletions ja/reference/streaming-replication.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,24 @@ PGroongaのWALは以下のようにスタンバイのサーバーへ送信され

```mermaid
sequenceDiagram
User->>+PostgreSQL backend:INSERT/UPDATE/DELETE
PostgreSQL backend->>+Primary Table:INSERT/UPDATE/DELETE
PostgreSQL backend->>+Primary PGroonga WAL:WAL Write
PostgreSQL backend->>+WAL Sender:Notify write WAL
WAL Sender->>+Primary PGroonga WAL:Read WAL
WAL Sender->>+WAL Reciver:Send WAL
WAL Reciver->>+Standby PGroonga WAL:Write
box transparent Primary
participant Primary user
participant Primary PGroonga
participant WAL sender
end
box transparent Standby
participant WAL receiver
participant Standby user
participant Standby PGroonga
end
Primary user->>+Primary PGroonga:INSERT/UPDATE/DELETE
Note right of Primary PGroonga:Write WAL
Primary PGroonga->>+WAL sender:Notify write WAL
WAL sender->>+WAL receiver:Send WAL
Note right of WAL receiver:Save WAL
Standby user->>+Standby PGroonga:SELECT
Note right of Standby PGroonga:Apply saved WAL
```

WALをサポートしているといってもクラッシュセーフではないことに注意してください。WALベースのストリーミングレプリケーションをサポートしているだけです。もし、PGroongaのインデックスを更新している最中にPostgreSQLがクラッシュしたら、そのPGroongaのインデックスは壊れるかもしれません。もし、PGroongaのインデックスが壊れたら[`REINDEX`][postgresql-reindex]で作り直さなければいけません。
Expand Down
25 changes: 18 additions & 7 deletions reference/streaming-replication.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,24 @@ PGroonga's WAL send to standby server from primary server as below.

```mermaid
sequenceDiagram
User->>+PostgreSQL backend:INSERT/UPDATE/DELETE
PostgreSQL backend->>+Primary Table:INSERT/UPDATE/DELETE
PostgreSQL backend->>+Primary PGroonga WAL:WAL Write
PostgreSQL backend->>+WAL Sender:Notify write WAL
WAL Sender->>+Primary PGroonga WAL:Read WAL
WAL Sender->>+WAL Reciver:Send WAL
WAL Reciver->>+Standby PGroonga WAL:Write
box transparent Primary
participant Primary user
participant Primary PGroonga
participant WAL sender
end
box transparent Standby
participant WAL receiver
participant Standby user
participant Standby PGroonga
end
Primary user->>+Primary PGroonga:INSERT/UPDATE/DELETE
Note right of Primary PGroonga:Write WAL
Primary PGroonga->>+WAL sender:Notify write WAL
WAL sender->>+WAL receiver:Send WAL
Note right of WAL receiver:Save WAL
Standby user->>+Standby PGroonga:SELECT
Note right of Standby PGroonga:Apply saved WAL
```

Note that WAL support doesn't mean crash safe. It just supports WAL based streaming replication. If PostgreSQL is crashed while PGroonga index update, the PGroonga index may be broken. If the PGroonga index is broken, you need to recreate the PGroonga index by [`REINDEX`][postgresql-reindex].
Expand Down

0 comments on commit a411b63

Please sign in to comment.