diff --git src/bin/pg_dump/pg_backup_archiver.c src/bin/pg_dump/pg_backup_archiver.c index 8f0b32ca17..449157a1b5 100644 --- src/bin/pg_dump/pg_backup_archiver.c +++ src/bin/pg_dump/pg_backup_archiver.c @@ -755,6 +755,7 @@ restore_toc_entry(ArchiveHandle *AH, TocEntry *te, bool is_parallel) int status = WORKER_OK; teReqs reqs; bool defnDumped; + printf("restore_toc_entry initial AH->FH: %d\n", ftello(AH->FH)); AH->currentTE = te; @@ -863,6 +864,7 @@ restore_toc_entry(ArchiveHandle *AH, TocEntry *te, bool is_parallel) if (AH->PrintTocDataPtr != NULL) { _printTocEntry(AH, te, true); + printf("restore_toc_entry _printTocEntry AH->FH: %d\n", ftello(AH->FH)); if (strcmp(te->desc, "BLOBS") == 0 || strcmp(te->desc, "BLOB COMMENTS") == 0) @@ -870,6 +872,7 @@ restore_toc_entry(ArchiveHandle *AH, TocEntry *te, bool is_parallel) pg_log_info("processing %s", te->desc); _selectOutputSchema(AH, "pg_catalog"); + printf("restore_toc_entry _selectOutputSchema AH->FH: %d\n", ftello(AH->FH)); /* Send BLOB COMMENTS data to ExecuteSimpleCommands() */ if (strcmp(te->desc, "BLOB COMMENTS") == 0) diff --git src/bin/pg_dump/pg_backup_custom.c src/bin/pg_dump/pg_backup_custom.c index 369dcea429..8eb7f465f8 100644 --- src/bin/pg_dump/pg_backup_custom.c +++ src/bin/pg_dump/pg_backup_custom.c @@ -415,10 +415,13 @@ _PrintTocData(ArchiveHandle *AH, TocEntry *te) lclTocEntry *tctx = (lclTocEntry *) te->formatData; int blkType; int id; + int thisPid = getpid(); if (tctx->dataState == K_OFFSET_NO_DATA) return; + printf("pid: %d, ctx->hasSeek: %d, tctx->dataState: %d, te->dumpId: %d\n", thisPid, + ctx->hasSeek, tctx->dataState, te->dumpId); if (!ctx->hasSeek || tctx->dataState == K_OFFSET_POS_NOT_SET) { /* @@ -427,6 +430,7 @@ _PrintTocData(ArchiveHandle *AH, TocEntry *te) * are asked to restore items out-of-order. */ _readBlockHeader(AH, &blkType, &id); + printf("initial readBlockHeader: blkType: %d, id: %d, AH->FH: %d\n", blkType, id, ftello(AH->FH)); while (blkType != EOF && id != te->dumpId) { @@ -446,6 +450,7 @@ _PrintTocData(ArchiveHandle *AH, TocEntry *te) break; } _readBlockHeader(AH, &blkType, &id); + printf("readBlockHeader: blkType: %d, id: %d, AH->FH: %d\n", blkType, id, ftello(AH->FH)); } } else @@ -496,6 +501,7 @@ _PrintTocData(ArchiveHandle *AH, TocEntry *te) blkType); break; } + printf("\n"); } /* @@ -773,6 +779,7 @@ _PrepParallelRestore(ArchiveHandle *AH) TocEntry *prev_te = NULL; lclTocEntry *prev_tctx = NULL; TocEntry *te; + printf("PrepParallelRestore\n"); /* * Knowing that the data items were dumped out in TOC order, we can @@ -800,6 +807,7 @@ _PrepParallelRestore(ArchiveHandle *AH) prev_te = te; prev_tctx = tctx; + printf("PrepParallelRestore prev_te: %d, prev_te->dataLength: %d\n", prev_te, prev_te->dataLength); } /* If OK to seek, we can determine the length of the last item */ @@ -812,6 +820,7 @@ _PrepParallelRestore(ArchiveHandle *AH) endpos = ftello(AH->FH); if (endpos > prev_tctx->dataPos) prev_te->dataLength = endpos - prev_tctx->dataPos; + printf("PrepParallelRestore endpos: %d, prev_te->dataLength: %d\n", endpos, prev_te->dataLength); } }