aio-debugging-0602.patch
text/x-patch
Filename: aio-debugging-0602.patch
Type: text/x-patch
Part: 0
Message:
Re: Non-reproducible AIO failure
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: unified
| File | + | − |
|---|---|---|
| src/backend/storage/aio/aio.c | 1 | 0 |
| src/backend/storage/aio/aio_io.c | 2 | 0 |
| src/backend/storage/buffer/bufmgr.c | 4 | 0 |
| src/test/perl/PostgreSQL/Test/Cluster.pm | 1 | 1 |
diff --git a/src/backend/storage/aio/aio.c b/src/backend/storage/aio/aio.c index c64d815ebd1..49ecb264d9d 100644 --- a/src/backend/storage/aio/aio.c +++ b/src/backend/storage/aio/aio.c @@ -668,6 +668,7 @@ pgaio_io_reclaim(PgAioHandle *ioh) Assert(ioh->owner_procno == MyProcNumber); Assert(ioh->state != PGAIO_HS_IDLE); +fprintf(stderr, "!!!pgaio_io_reclaim [%d]| ioh: %p, ioh->op: %d, ioh->state: %d, ioh->result: %d, ioh->num_callbacks: %d\n", getpid(), ioh, ioh->op, ioh->state, ioh->result, ioh->num_callbacks); /* see comment in function header */ HOLD_INTERRUPTS(); diff --git a/src/backend/storage/aio/aio_io.c b/src/backend/storage/aio/aio_io.c index 00e176135a6..2ae78217871 100644 --- a/src/backend/storage/aio/aio_io.c +++ b/src/backend/storage/aio/aio_io.c @@ -85,6 +85,7 @@ pgaio_io_start_readv(PgAioHandle *ioh, ioh->op_data.read.iov_length = iovcnt; pgaio_io_stage(ioh, PGAIO_OP_READV); +fprintf(stderr, "!!!pgaio_io_start_readv [%d]| ioh: %p, ioh->op: %d\n", getpid(), ioh, ioh->op); } void @@ -158,6 +159,7 @@ pgaio_io_before_start(PgAioHandle *ioh) Assert(ioh->state == PGAIO_HS_HANDED_OUT); Assert(pgaio_my_backend->handed_out_io == ioh); Assert(pgaio_io_has_target(ioh)); +if (ioh->op != PGAIO_OP_INVALID) elog(LOG, "!!!pgaio_io_before_start| ioh: %p, ioh->op: %d, ioh->state: %d, ioh->result: %d, ioh->num_callbacks: %d", ioh, ioh->op, ioh->state, ioh->result, ioh->num_callbacks); Assert(ioh->op == PGAIO_OP_INVALID); /* diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c index f93131a645e..4bb428b2875 100644 --- a/src/backend/storage/buffer/bufmgr.c +++ b/src/backend/storage/buffer/bufmgr.c @@ -67,6 +67,7 @@ #include "utils/resowner.h" #include "utils/timestamp.h" +#include "storage/aio_internal.h" /* Note: these two macros only work on shared buffers, not local ones! */ #define BufHdrGetBlock(bufHdr) ((Block) (BufferBlocks + ((Size) (bufHdr)->buf_id) * BLCKSZ)) @@ -1855,7 +1856,10 @@ AsyncReadBuffers(ReadBuffersOperation *operation, int *nblocks_progress) pgaio_submit_staged(); ioh = pgaio_io_acquire(CurrentResourceOwner, &operation->io_return); +fprintf(stderr, "!!!AsyncReadBuffers [%d] (2)| blocknum: %d, ioh: %p, ioh->op: %d, ioh->state: %d, ioh->result: %d, ioh->num_callbacks: %d\n", getpid(), blocknum, ioh, ((PgAioHandle *)ioh)->op, ((PgAioHandle *)ioh)->state, ((PgAioHandle *)ioh)->result, ((PgAioHandle *)ioh)->num_callbacks); } +else +fprintf(stderr, "!!!AsyncReadBuffers [%d] (1)| blocknum: %d, ioh: %p, ioh->op: %d, ioh->state: %d, ioh->result: %d, ioh->num_callbacks: %d\n", getpid(), blocknum, ioh, ((PgAioHandle *)ioh)->op, ((PgAioHandle *)ioh)->state, ((PgAioHandle *)ioh)->result, ((PgAioHandle *)ioh)->num_callbacks); /* * Check if we can start IO on the first to-be-read buffer. diff --git a/src/test/perl/PostgreSQL/Test/Cluster.pm b/src/test/perl/PostgreSQL/Test/Cluster.pm index 1c11750ac1d..1135d6dc399 100644 --- a/src/test/perl/PostgreSQL/Test/Cluster.pm +++ b/src/test/perl/PostgreSQL/Test/Cluster.pm @@ -712,7 +712,7 @@ sub init print $conf "wal_log_hints = on\n"; print $conf "hot_standby = on\n"; # conservative settings to ensure we can run multiple postmasters: - print $conf "shared_buffers = 1MB\n"; + print $conf "shared_buffers = 512kB\n"; print $conf "max_connections = 10\n"; # limit disk space consumption, too: print $conf "max_wal_size = 128MB\n";