Skip to content

Commit d824726

Browse files
committed
StartReadBuffers debug stuff
1 parent f5a9dba commit d824726

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

src/backend/storage/buffer/bufmgr.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1777,6 +1777,18 @@ AsyncReadBuffers(ReadBuffersOperation *operation, int *nblocks_progress)
17771777
IOObject io_object;
17781778
bool did_start_io;
17791779

1780+
#if 0
1781+
ereport(DEBUG3,
1782+
errmsg("%s: op->blocks: %d, op->blocks_done: %d, *nblocks_progress: %d, first buf %d",
1783+
__func__,
1784+
operation->nblocks,
1785+
nblocks_done,
1786+
*nblocks_progress,
1787+
buffers[0]),
1788+
errhidestmt(true),
1789+
errhidecontext(true));
1790+
#endif
1791+
17801792
/*
17811793
* When this IO is executed synchronously, either because the caller will
17821794
* immediately block waiting for the IO or because IOMETHOD_SYNC is used,
@@ -1870,6 +1882,13 @@ AsyncReadBuffers(ReadBuffersOperation *operation, int *nblocks_progress)
18701882
operation->nblocks_done += 1;
18711883
*nblocks_progress = 1;
18721884

1885+
ereport(DEBUG3,
1886+
errmsg("%s - trunc: %d",
1887+
__func__,
1888+
operation->nblocks_done),
1889+
errhidestmt(true),
1890+
errhidecontext(true));
1891+
18731892
pgaio_io_release(ioh);
18741893
pgaio_wref_clear(&operation->io_wref);
18751894
did_start_io = false;
@@ -1916,6 +1935,12 @@ AsyncReadBuffers(ReadBuffersOperation *operation, int *nblocks_progress)
19161935
*/
19171936
for (int i = nblocks_done + 1; i < operation->nblocks; i++)
19181937
{
1938+
#if 0
1939+
/* FIXME: Remove forced short read */
1940+
if (i > 3)
1941+
break;
1942+
#endif
1943+
19191944
if (!ReadBuffersCanStartIO(buffers[i], true))
19201945
break;
19211946
/* Must be consecutive block numbers. */

0 commit comments

Comments
 (0)