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

Commit78baca7

Browse files
author
Viktoria Shepard
committed
Merge branch 'ce-PBCKP-649-remove-cfs' into 'ce'
PBCKP-649 remove cfsCloses PBCKP-649See merge request eepbk/ptrack_ee!2
2 parentsf4c24d6 +f1f72f8 commit78baca7

File tree

5 files changed

+3
-280
lines changed

5 files changed

+3
-280
lines changed

‎engine.c

Lines changed: 1 addition & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@
3636
#include"catalog/pg_tablespace.h"
3737
#include"miscadmin.h"
3838
#include"port/pg_crc32c.h"
39-
#ifdefPGPRO_EE
40-
/* For file_is_in_cfs_tablespace() only. */
41-
#include"common/cfs_common.h"
42-
#endif
4339
#include"storage/copydir.h"
4440
#ifPG_VERSION_NUM >=120000
4541
#include"storage/md.h"
@@ -95,53 +91,6 @@ ptrack_write_chunk(int fd, pg_crc32c *crc, char *chunk, size_t size)
9591
}
9692
}
9793

98-
/*
99-
* Determines whether given file path is a path to a cfm file.
100-
*/
101-
bool
102-
is_cfm_file_path(constchar*filepath) {
103-
ssize_tlen=strlen(filepath);
104-
105-
// For this length checks we assume that the filename is at least
106-
// 1 character longer than the corresponding extension ".cfm":
107-
// strlen(".cfm") == 4 therefore we assume that the filename can't be
108-
// shorter than 5 bytes, for example: "5.cfm".
109-
returnstrlen(filepath) >=5&&strcmp(&filepath[len-4],".cfm")==0;
110-
}
111-
112-
#ifCFS_SUPPORT
113-
/*
114-
* Determines the relation file size specified by fullpath as if it
115-
* was not compressed.
116-
*/
117-
off_t
118-
get_cfs_relation_file_decompressed_size(RelFileNodeBackendrnode,constchar*fullpath,ForkNumberforknum) {
119-
Filefd;
120-
off_tsize;
121-
122-
#ifPG_VERSION_NUM >=120000
123-
intcompressor;
124-
compressor=md_get_compressor_internal(nodeOf(rnode),rnode.backend,forknum);
125-
fd=PathNameOpenFile(fullpath,O_RDWR |PG_BINARY,compressor);
126-
#else
127-
fd=PathNameOpenFile(fullpath,O_RDWR |PG_BINARY |PG_COMPRESSION);
128-
#endif
129-
130-
if(fd<0)
131-
return (off_t)-1;
132-
133-
#ifPG_VERSION_NUM >=120000
134-
size=FileSize(fd);
135-
#else
136-
size=FileSeek(fd,0,SEEK_END);
137-
#endif
138-
139-
FileClose(fd);
140-
141-
returnsize;
142-
}
143-
#endif
144-
14594
/*
14695
* Delete ptrack files when ptrack is disabled.
14796
*
@@ -549,13 +498,8 @@ assign_ptrack_map_size(int newval, void *extra)
549498
* For use in functions that copy directories bypassing buffer manager.
550499
*/
551500
staticvoid
552-
#ifCFS_SUPPORT
553-
ptrack_mark_file(OiddbOid,OidtablespaceOid,
554-
constchar*filepath,constchar*filename,boolis_cfs)
555-
#else
556501
ptrack_mark_file(OiddbOid,OidtablespaceOid,
557502
constchar*filepath,constchar*filename)
558-
#endif
559503
{
560504
RelFileNodeBackendrnode;
561505
ForkNumberforknum;
@@ -564,9 +508,6 @@ ptrack_mark_file(Oid dbOid, Oid tablespaceOid,
564508
structstatstat_buf;
565509
intoidchars;
566510
charoidbuf[OIDCHARS+1];
567-
#ifCFS_SUPPORT
568-
off_trel_size;
569-
#endif
570511

571512
/* Do not track temporary relations */
572513
if (looks_like_temp_rel_name(filename))
@@ -585,21 +526,6 @@ ptrack_mark_file(Oid dbOid, Oid tablespaceOid,
585526
oidbuf[oidchars]='\0';
586527
nodeRel(nodeOf(rnode))=atooid(oidbuf);
587528

588-
#ifCFS_SUPPORT
589-
// if current tablespace is cfs-compressed and md_get_compressor_internal
590-
// returns the type of the compressing algorithm for filepath, then it
591-
// needs to be de-compressed to obtain its size
592-
if(is_cfs&&md_get_compressor_internal(nodeOf(rnode),rnode.backend,forknum)!=0) {
593-
rel_size=get_cfs_relation_file_decompressed_size(rnode,filepath,forknum);
594-
595-
if(rel_size== (off_t)-1) {
596-
elog(WARNING,"ptrack: could not open cfs-compressed relation file: %s",filepath);
597-
return;
598-
}
599-
600-
nblocks=rel_size /BLCKSZ;
601-
}else
602-
#endif
603529
/* Compute number of blocks based on file size */
604530
if (stat(filepath,&stat_buf)==0)
605531
nblocks=stat_buf.st_size /BLCKSZ;
@@ -620,9 +546,6 @@ ptrack_walkdir(const char *path, Oid tablespaceOid, Oid dbOid)
620546
{
621547
DIR*dir;
622548
structdirent*de;
623-
#ifCFS_SUPPORT
624-
boolis_cfs;
625-
#endif
626549

627550
/* Do not walk during bootstrap and if ptrack is disabled */
628551
if (ptrack_map_size==0
@@ -631,10 +554,6 @@ ptrack_walkdir(const char *path, Oid tablespaceOid, Oid dbOid)
631554
||InitializingParallelWorker)
632555
return;
633556

634-
#ifCFS_SUPPORT
635-
is_cfs=file_is_in_cfs_tablespace(path);
636-
#endif
637-
638557
dir=AllocateDir(path);
639558

640559
while ((de=ReadDirExtended(dir,path,LOG))!=NULL)
@@ -662,11 +581,7 @@ ptrack_walkdir(const char *path, Oid tablespaceOid, Oid dbOid)
662581
}
663582

664583
if (S_ISREG(fst.st_mode))
665-
#ifCFS_SUPPORT
666-
ptrack_mark_file(dbOid,tablespaceOid,subpath,de->d_name,is_cfs);
667-
#else
668-
ptrack_mark_file(dbOid,tablespaceOid,subpath,de->d_name);
669-
#endif
584+
ptrack_mark_file(dbOid,tablespaceOid,subpath,de->d_name);
670585
}
671586

672587
FreeDir(dir);/* we ignore any error here */

‎engine.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@
4444
#definePTRACK_MAGIC "ptk"
4545
#definePTRACK_MAGIC_SIZE 4
4646

47-
/* CFS support macro */
48-
#if defined(PGPRO_EE)&&PG_VERSION_NUM >=110000
49-
#defineCFS_SUPPORT 1
50-
#endif
51-
5247
/*
5348
* Header of ptrack map.
5449
*/
@@ -116,10 +111,4 @@ extern void ptrack_walkdir(const char *path, Oid tablespaceOid, Oid dbOid);
116111
externvoidptrack_mark_block(RelFileNodeBackendsmgr_rnode,
117112
ForkNumberforkno,BlockNumberblkno);
118113

119-
externboolis_cfm_file_path(constchar*path);
120-
#ifdefPGPRO_EE
121-
externoff_tget_cfs_relation_file_decompressed_size(RelFileNodeBackendrnode,
122-
constchar*fullpath,ForkNumberforknum);
123-
#endif
124-
125114
#endif/* PTRACK_ENGINE_H */

‎ptrack.c

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@
3636
#include"funcapi.h"
3737
#include"miscadmin.h"
3838
#include"nodes/pg_list.h"
39-
#ifdefPGPRO_EE
40-
/* For file_is_in_cfs_tablespace() only. */
41-
#include"common/cfs_common.h"
42-
#endif
4339
#include"port/pg_crc32c.h"
4440
#include"storage/copydir.h"
4541
#include"storage/ipc.h"
@@ -294,12 +290,6 @@ ptrack_gather_filelist(List **filelist, char *path, Oid spcOid, Oid dbOid)
294290
{
295291
DIR*dir;
296292
structdirent*de;
297-
#ifCFS_SUPPORT
298-
boolis_cfs;
299-
300-
is_cfs=file_is_in_cfs_tablespace(path);
301-
#endif
302-
303293
dir=AllocateDir(path);
304294

305295
while ((de=ReadDirExtended(dir,path,LOG))!=NULL)
@@ -312,8 +302,7 @@ ptrack_gather_filelist(List **filelist, char *path, Oid spcOid, Oid dbOid)
312302

313303
if (strcmp(de->d_name,".")==0||
314304
strcmp(de->d_name,"..")==0||
315-
looks_like_temp_rel_name(de->d_name)||
316-
is_cfm_file_path(de->d_name))
305+
looks_like_temp_rel_name(de->d_name))
317306
continue;
318307

319308
snprintf(subpath,sizeof(subpath),"%s/%s",path,de->d_name);
@@ -364,10 +353,6 @@ ptrack_gather_filelist(List **filelist, char *path, Oid spcOid, Oid dbOid)
364353
nodeSpc(pfl->relnode)=spcOid==InvalidOid ?DEFAULTTABLESPACE_OID :spcOid;
365354
pfl->path=GetRelationPath(dbOid,nodeSpc(pfl->relnode),
366355
nodeRel(pfl->relnode),InvalidBackendId,pfl->forknum);
367-
#ifCFS_SUPPORT
368-
pfl->is_cfs_compressed=is_cfs
369-
&&md_get_compressor_internal(pfl->relnode,InvalidBackendId,pfl->forknum)!=0;
370-
#endif
371356

372357
*filelist=lappend(*filelist,pfl);
373358

@@ -410,9 +395,6 @@ ptrack_filelist_getnext(PtScanCtx * ctx)
410395
char*fullpath;
411396
structstatfst;
412397
off_trel_st_size=0;
413-
#ifCFS_SUPPORT
414-
RelFileNodeBackendrnodebackend;
415-
#endif
416398

417399
get_next:
418400

@@ -461,18 +443,6 @@ ptrack_filelist_getnext(PtScanCtx * ctx)
461443
gotoget_next;
462444
}
463445

464-
#ifCFS_SUPPORT
465-
nodeOf(rnodebackend)=ctx->bid.relnode;
466-
rnodebackend.backend=InvalidBackendId;
467-
468-
if(pfl->is_cfs_compressed) {
469-
rel_st_size=get_cfs_relation_file_decompressed_size(rnodebackend,fullpath,pfl->forknum);
470-
471-
// Could not open fullpath for some reason, trying the next file.
472-
if(rel_st_size==-1)
473-
gotoget_next;
474-
}else
475-
#endif
476446
rel_st_size=fst.st_size;
477447

478448
if (pfl->segno>0)

‎ptrack.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,7 @@ typedef struct PtrackFileList_i
7878
ForkNumberforknum;
7979
intsegno;
8080
char*path;
81-
#ifdefPGPRO_EE
82-
boolis_cfs_compressed;
83-
#endif
81+
8482
}PtrackFileList_i;
8583

8684
#endif/* PTRACK_H */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp