FK locking concurrency improvement

From: Daniel Wood <dwood(at)salesforce(dot)com>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: FK locking concurrency improvement
Date: 2013-05-20 19:30:14
Message-ID: 519A79C6.90308@salesforce.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

As part of 0ac5ad5134f2769ccbaefec73844f8504c4d6182
the permutations in test/isolation/fk-deadlock2.spec and elsewhere were
removed. Is it the intent that these tests no longer do anything
useful? I was expecting a failure in the test with some work I'm doing
and was confused, after a merge from the upstream 9.3, that the test
didn't fail until I noticed the test is no longer running the permutations.

FYI, I saw some comments and adding fflush's into isolationtester.c. I
ran into the same problem with debugging tests when they failed/hung in
the middle. A simple "setbuf(stdout, NULL)" at the beginning of main
gets rid of the problem where line buffering becomes block buffering
when redirecting stdout to a file. This causes problems with sequencing
of mixed stderr and stdout and not seeing the last few lines of stdout
if the process fails or hangs. The setbuf on stdout shown above
disables buffering of stdout to match the unbuffered stderr.

That way you don't need to fflush after each printf/fprintf. I'm not
sure why fflush of stderr was added because it isn't buffered to begin
with so is unnecessary. The problem was with stdout. YMMV on windows
but might work.

- Dan

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2013-05-20 19:34:08 Re: Proposal to add --single-row to psql
Previous Message Simon Riggs 2013-05-20 19:18:12 Re: Fast promotion failure