[pgcluster: 590] Re: シーケンス番号の整合性が崩れる

mitani mitani @ sraw.co.jp
2004年 11月 2日 (火) 16:54:28 JST


三谷@広島です.

> > > クエリーが複数に分割されてしまうくらい大きなクエリーは,クラスタDB間でク
> > > エリーが投げられる時間に差が生じます.このような大きなクエリーでシーケン
> > > ス型データを操作する場合,トランザクションで包んで,nextvalやsetvalを使っ
> > > て明示的にシーケンスを操作する必要があるのかもしれません.
すみません.
説明が間違ってました.

INSERTされるデータが大きくて,送信が分割される場合でも
レプリケーションサーバ内でバーチャルキューに入れてレプリケーション
していますので,クエリーが送られる(時間に差は出来ますが)順番は変わりま
せん.したがってシーケンスデータが崩れることはないです.

[pgcluster: 580]で高橋さんが書かれた通り検証してみました.

ClusterDBは3台,レプリケーションサーバ1台です.
結果は3台ともシーケンスのIDは崩れていませんでした.


<クラスタ1の結果>
[postgres @ dual postgres]$ psql -p 5001 test
Welcome to psql 7.3.6, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help on internal slash commands
       \g or terminate with semicolon to execute query
       \q to quit

test=# select id from test where name like '%x%';
 id
-----
 677
(1 row)

<クラスタ2の結果>
[postgres @ dual serial_test]$ psql -p 5002 test
Welcome to psql 7.3.6, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help on internal slash commands
       \g or terminate with semicolon to execute query
       \q to quit

test=# select id from test where name like '%x%';
 id
-----
 677
(1 row)

<クラスタ3の結果>
[postgres @ dual serial_test]$ psql -p 5003 test
Welcome to psql 7.3.6, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help on internal slash commands
       \g or terminate with semicolon to execute query
       \q to quit

test=# select id from test where name like '%x%';
 id
-----
 677
(1 row)



シリアルテーブルが崩れているのかもしれませんので,念のため,
DROP DB
CREATEDB
をして,再検証してみていただけませんでしょうか.

よろしくお願いします.

=============================
三谷 篤<mitani @ sraw.co.jp>
=============================




pgcluster メーリングリストの案内