Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Pbckp 278 cfs ptrack review fixes#28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
daniel-95 merged 3 commits intomasterfromPBCKP-278_cfs-ptrack
Dec 7, 2022
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletionsengine.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -109,7 +109,7 @@ is_cfm_file_path(const char *filepath) {
return strlen(filepath) >= 5 && strcmp(&filepath[len-4], ".cfm") == 0;
}

#ifdef PGPRO_EE
#if CFS_SUPPORT
/*
* Determines the relation file size specified by fullpath as if it
* was not compressed.
Expand All@@ -120,7 +120,7 @@ get_cfs_relation_file_decompressed_size(RelFileNodeBackend rnode, const char *fu
int compressor;
off_t size;

compressor = md_get_compressor_internal(rnode.node, rnode.backend, forknum);
compressor = md_get_compressor_internal(nodeOf(rnode), rnode.backend, forknum);
fd = PathNameOpenFile(fullpath, O_RDWR | PG_BINARY, compressor);

if(fd < 0)
Expand DownExpand Up@@ -540,7 +540,7 @@ assign_ptrack_map_size(int newval, void *extra)
* For use in functions that copy directories bypassing buffer manager.
*/
static void
#ifdef PGPRO_EE
#if CFS_SUPPORT
ptrack_mark_file(Oid dbOid, Oid tablespaceOid,
const char *filepath, const char *filename, bool is_cfs)
#else
Expand All@@ -555,7 +555,7 @@ ptrack_mark_file(Oid dbOid, Oid tablespaceOid,
struct stat stat_buf;
intoidchars;
charoidbuf[OIDCHARS + 1];
#ifdef PGPRO_EE
#if CFS_SUPPORT
off_t rel_size;
#endif

Expand All@@ -576,11 +576,11 @@ ptrack_mark_file(Oid dbOid, Oid tablespaceOid,
oidbuf[oidchars] = '\0';
nodeRel(nodeOf(rnode)) = atooid(oidbuf);

#ifdef PGPRO_EE
#if CFS_SUPPORT
// if current tablespace is cfs-compressed and md_get_compressor_internal
// returns the type of the compressing algorithm for filepath, then it
// needs to be de-compressed to obtain its size
if(is_cfs && md_get_compressor_internal(rnode.node, rnode.backend, forknum) != 0) {
if(is_cfs && md_get_compressor_internal(nodeOf(rnode), rnode.backend, forknum) != 0) {
rel_size = get_cfs_relation_file_decompressed_size(rnode, filepath, forknum);

if(rel_size == (off_t)-1) {
Expand DownExpand Up@@ -611,7 +611,7 @@ ptrack_walkdir(const char *path, Oid tablespaceOid, Oid dbOid)
{
DIR *dir;
struct dirent *de;
#ifdef PGPRO_EE
#if CFS_SUPPORT
bool is_cfs;
#endif

Expand All@@ -622,7 +622,7 @@ ptrack_walkdir(const char *path, Oid tablespaceOid, Oid dbOid)
|| InitializingParallelWorker)
return;

#ifdef PGPRO_EE
#if CFS_SUPPORT
is_cfs = file_is_in_cfs_tablespace(path);
#endif

Expand DownExpand Up@@ -653,7 +653,7 @@ ptrack_walkdir(const char *path, Oid tablespaceOid, Oid dbOid)
}

if (S_ISREG(fst.st_mode))
#ifdef PGPRO_EE
#if CFS_SUPPORT
ptrack_mark_file(dbOid, tablespaceOid, subpath, de->d_name, is_cfs);
#else
ptrack_mark_file(dbOid, tablespaceOid, subpath, de->d_name);
Expand Down
5 changes: 5 additions & 0 deletionsengine.h
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -44,6 +44,11 @@
#define PTRACK_MAGIC "ptk"
#define PTRACK_MAGIC_SIZE 4

/* CFS support macro */
#if defined(PGPRO_EE) && PG_VERSION_NUM >= 120000
#define CFS_SUPPORT 1
#endif

/*
* Header of ptrack map.
*/
Expand Down
10 changes: 5 additions & 5 deletionsptrack.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -294,7 +294,7 @@ ptrack_gather_filelist(List **filelist, char *path, Oid spcOid, Oid dbOid)
{
DIR *dir;
struct dirent *de;
#ifdef PGPRO_EE
#if CFS_SUPPORT
bool is_cfs;

is_cfs = file_is_in_cfs_tablespace(path);
Expand DownExpand Up@@ -360,7 +360,7 @@ ptrack_gather_filelist(List **filelist, char *path, Oid spcOid, Oid dbOid)
nodeSpc(pfl->relnode) = spcOid == InvalidOid ? DEFAULTTABLESPACE_OID : spcOid;
pfl->path = GetRelationPath(dbOid, nodeSpc(pfl->relnode),
nodeRel(pfl->relnode), InvalidBackendId, pfl->forknum);
#ifdef PGPRO_EE
#if CFS_SUPPORT
pfl->is_cfs_compressed = is_cfs
&& md_get_compressor_internal(pfl->relnode, InvalidBackendId, pfl->forknum) != 0;
#endif
Expand DownExpand Up@@ -406,7 +406,7 @@ ptrack_filelist_getnext(PtScanCtx * ctx)
char *fullpath;
struct stat fst;
off_t rel_st_size = 0;
#ifdef PGPRO_EE
#if CFS_SUPPORT
RelFileNodeBackend rnodebackend;
#endif

Expand DownExpand Up@@ -455,8 +455,8 @@ ptrack_filelist_getnext(PtScanCtx * ctx)
return ptrack_filelist_getnext(ctx);
}

#ifdef PGPRO_EE
rnodebackend.node = ctx->bid.relnode;
#if CFS_SUPPORT
nodeOf(rnodebackend) = ctx->bid.relnode;
rnodebackend.backend = InvalidBackendId;

if(pfl->is_cfs_compressed) {
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp