From b2f2fdf7a46ad8d4487d8bc1e6859596a596861b Mon Sep 17 00:00:00 2001 From: Daniel Shelepanov Date: Fri, 11 Nov 2022 12:36:47 +0300 Subject: [PATCH] [PBCKP-334] Unified segno code for any fork In fact, any fork (not only MAIN_FORKNUM) can have multiple segments. tags: ptrack --- ptrack.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/ptrack.c b/ptrack.c index 2b71878..15d5d86 100644 --- a/ptrack.c +++ b/ptrack.c @@ -345,15 +345,11 @@ ptrack_gather_filelist(List **filelist, char *path, Oid spcOid, Oid dbOid) if (!parse_filename_for_nontemp_relation(de->d_name, &oidchars, &pfl->forknum)) continue; - /* Parse segno for main fork */ - if (pfl->forknum == MAIN_FORKNUM) - { - segpath = strstr(de->d_name, "."); - pfl->segno = segpath != NULL ? atoi(segpath + 1) : 0; - } - else - pfl->segno = 0; + /* Parse segno */ + segpath = strstr(de->d_name, "."); + pfl->segno = segpath != NULL ? atoi(segpath + 1) : 0; + /* Fill the pfl in */ memcpy(oidbuf, de->d_name, oidchars); oidbuf[oidchars] = '\0'; pfl->relnode.relNode = atooid(oidbuf);