[pgsql-jp: 34196] PostgreSQLと外部ディスクとの接続についての質問

上野 礼美 ueno.ayami @ nttcom.co.jp
2004年 10月 28日 (木) 14:34:42 JST


上野と申します。初めて投稿します。よろしくお願いします。

私の方で、PostgreSQL7.4.5を導入したサーバと、外部ディスクを接続した環境で、
DBサーバを構築しておりますが、その際に下記のような問題が発生しました。原因・
対処法について、ご意見・お知恵を頂けたらと思い、投稿致しました。よろしくお願
い致します。

(問題内容)
Linux上にPostgreSQLを導入したDBサーバに対して、1sおきにクライアントから
insertを発行した。この最中に、サーバと外部ディスクを接続しているSCSIケーブル
を抜いたところ、抜いてから約110sの間PostgreSQLサーバからクライアントに正常応
答が返ってきて、その後からエラー応答が返ってくるようになった。
サーバの再起動後にinsertしたテーブルのレコード状況を確認してみると、110sの間
に
insertしたレコードは当然作られていなかった。
→SCSIケーブルを抜いたらすぐに、クライアントからの問い合わせに対しエラー応答
を
返すようにしたい。変更すべき設定・対処法などありますでしょうか?
また、この辺りのPostgreSQLの仕組み・原因についても、わかればと思っておりま
す。
なお、同じ環境で、PostgreSQLではなく別の市販RDBMSで同じことを行ったところ、
その場合はSCSIケーブルを抜いた直後から、クライアントへエラーを返却しました。

(ログ)
この時のログを下記に添付します。下のログはケーブルを抜いてから110秒前後のも
のです。
Oct 28 11:55:15 xxxxxxxx postgres[1813]: [478-1] DEBUG:  forked new backend,
pid=2030 socket=6
Oct 28 11:55:15 xxxxxxxx postgres[2030]: [478-1] LOG:  connection received:
host=aaa.bbb.ccc.ddd port=33357
Oct 28 11:55:15 xxxxxxxx postgres[2030]: [479-1] LOG:  connection
authorized: user=postgres database=pg_vcs1
Oct 28 11:55:15 xxxxxxxx postgres[2030]: [480-1] DEBUG:
/usr/local/pgsql/bin/postmaster child[2030]: starting with (
Oct 28 11:55:15 xxxxxxxx postgres[2030]: [481-1] DEBUG:  	postgres
Oct 28 11:55:15 xxxxxxxx postgres[2030]: [482-1] DEBUG:  	-v196608
Oct 28 11:55:15 xxxxxxxx postgres[2030]: [483-1] DEBUG:  	-p
Oct 28 11:55:15 xxxxxxxx postgres[2030]: [484-1] DEBUG:  	pg_vcs1
Oct 28 11:55:15 xxxxxxxx postgres[2030]: [485-1] DEBUG:  )
Oct 28 11:55:15 xxxxxxxx postgres[2030]: [486-1] DEBUG:  InitPostgres
Oct 28 11:55:15 xxxxxxxx postgres[2030]: [487-1] DEBUG:
StartTransactionCommand
Oct 28 11:55:15 xxxxxxxx postgres[2030]: [488-1] LOG:  statement: insert
into test_table (num, var) values (146, 'abc') ← この問い合わせに対し、実
際はSCSIケーブルが抜けている状態だが、正常終了してしまう。、
Oct 28 11:55:15 xxxxxxxx postgres[2030]: [489-1] DEBUG:  ProcessQuery
Oct 28 11:55:15 xxxxxxxx postgres[2030]: [490-1] DEBUG:
CommitTransactionCommand
Oct 28 11:55:15 xxxxxxxx postgres[2030]: [491-1] DEBUG:  proc_exit(0)
Oct 28 11:55:15 xxxxxxxx postgres[2030]: [492-1] DEBUG:  shmem_exit(0)
Oct 28 11:55:15 xxxxxxxx postgres[2030]: [493-1] DEBUG:  exit(0)
Oct 28 11:55:15 xxxxxxxx postgres[1813]: [479-1] DEBUG:  reaping dead
processes
Oct 28 11:55:15 xxxxxxxx postgres[1813]: [480-1] DEBUG:  child process (PID
2030) exited with exit code 0
Oct 28 11:55:16 xxxxxxxx postgres[2031]: [481-1] LOG:  connection received:
host=aaa.bbb.ccc.ddd port=33358
Oct 28 11:55:16 xxxxxxxx postgres[2031]: [482-1] LOG:  connection
authorized: user=postgres database=pg_vcs1
Oct 28 11:55:16 xxxxxxxx postgres[1813]: [481-1] DEBUG:  forked new backend,
pid=2031 socket=6
Oct 28 11:55:16 xxxxxxxx postgres[2031]: [483-1] DEBUG:
/usr/local/pgsql/bin/postmaster child[2031]: starting with (
Oct 28 11:55:16 xxxxxxxx postgres[2031]: [484-1] DEBUG:  	postgres
Oct 28 11:55:16 xxxxxxxx postgres[2031]: [485-1] DEBUG:  	-v196608
Oct 28 11:55:16 xxxxxxxx postgres[2031]: [486-1] DEBUG:  	-p
Oct 28 11:55:16 xxxxxxxx postgres[2031]: [487-1] DEBUG:  	pg_vcs1
Oct 28 11:55:16 xxxxxxxx postgres[2031]: [488-1] DEBUG:  )
Oct 28 11:55:16 xxxxxxxx postgres[2031]: [489-1] DEBUG:  InitPostgres
Oct 28 11:55:16 xxxxxxxx postgres[2031]: [490-1] DEBUG:
StartTransactionCommand
Oct 28 11:55:16 xxxxxxxx postgres[2031]: [491-1] LOG:  statement: insert
into test_table (num, var) values (147, 'abc') ← この問い合わせに対して
は、2行下にERROR、HINT行がある為か、クライアントにエラーを返却する
Oct 28 11:55:16 xxxxxxxx postgres[2031]: [492-1] DEBUG:  ProcessQuery
Oct 28 11:55:16 xxxxxxxx postgres[2031]: [493-1] ERROR:  could not extend
relation "test_table": 入力/出力エラーです
Oct 28 11:55:16 xxxxxxxx postgres[2031]: [493-2] HINT:  Check free disk
space.
Oct 28 11:55:16 xxxxxxxx postgres[2031]: [494-1] DEBUG:
AbortCurrentTransaction
Oct 28 11:55:16 xxxxxxxx postgres[2031]: [495-1] DEBUG:  proc_exit(0)
Oct 28 11:55:16 xxxxxxxx postgres[2031]: [496-1] DEBUG:  shmem_exit(0)
Oct 28 11:55:16 xxxxxxxx postgres[2031]: [497-1] DEBUG:  exit(0)
Oct 28 11:55:16 xxxxxxxx postgres[1813]: [482-1] DEBUG:  reaping dead
processes
Oct 28 11:55:16 xxxxxxxx postgres[1813]: [483-1] DEBUG:  child process (PID
2031) exited with exit code 0

尚、xxxxxxxxはサーバのホスト名、aaa.bbb.ccc.dddはクライアントのIPアドレスで
す。




pgsql-jp メーリングリストの案内