This is an automated email from the ASF dual-hosted git repository.
chenjinbao1989 pushed a commit to branch cbdb-postgres-merge
in repository https://gitbox.apache.org/repos/asf/cloudberry.git
The following commit(s) were added to refs/heads/cbdb-postgres-merge by this
push:
new 7e3aa77750e Fix compiling errors for pax storage
7e3aa77750e is described below
commit 7e3aa77750eafa34a6c73d538e322ed265dc35c2
Author: Jinbao Chen <[email protected]>
AuthorDate: Wed Mar 11 22:27:25 2026 -0400
Fix compiling errors for pax storage
---
.../src/cpp/access/pax_access_handle.cc | 6 +--
.../pax_storage/src/cpp/access/pax_access_handle.h | 7 +--
.../src/cpp/access/pax_access_method_internal.cc | 12 ++---
contrib/pax_storage/src/cpp/access/pax_deleter.cc | 2 +-
contrib/pax_storage/src/cpp/access/pax_scanner.cc | 2 +-
contrib/pax_storage/src/cpp/access/pax_updater.cc | 6 +--
contrib/pax_storage/src/cpp/access/pax_updater.h | 2 +-
contrib/pax_storage/src/cpp/access/pax_visimap.cc | 2 +-
.../pax_storage/src/cpp/catalog/pax_aux_table.cc | 14 ++---
.../pax_storage/src/cpp/catalog/pax_aux_table.h | 6 +--
contrib/pax_storage/src/cpp/catalog/pax_catalog.h | 2 +-
.../pax_storage/src/cpp/catalog/pax_manifest.cc | 10 ++--
contrib/pax_storage/src/cpp/comm/cbdb_wrappers.cc | 12 ++---
contrib/pax_storage/src/cpp/comm/cbdb_wrappers.h | 4 +-
contrib/pax_storage/src/cpp/comm/paxc_wrappers.cc | 15 +++---
contrib/pax_storage/src/cpp/comm/paxc_wrappers.h | 4 +-
.../pax_storage/src/cpp/storage/micro_partition.h | 2 +-
.../src/cpp/storage/micro_partition_iterator.cc | 8 +--
contrib/pax_storage/src/cpp/storage/pax.cc | 11 ++--
contrib/pax_storage/src/cpp/storage/paxc_smgr.cc | 10 ++--
.../pax_storage/src/cpp/storage/toast/pax_toast.cc | 8 +--
contrib/pax_storage/src/cpp/storage/wal/pax_wal.cc | 6 +--
contrib/pax_storage/src/cpp/storage/wal/pax_wal.h | 6 +--
.../pax_storage/src/cpp/storage/wal/paxc_desc.c | 8 +--
.../pax_storage/src/cpp/storage/wal/paxc_desc.h | 10 ++--
.../pax_storage/src/cpp/storage/wal/paxc_wal.cc | 62 +++++++++++-----------
contrib/pax_storage/src/cpp/storage/wal/paxc_wal.h | 10 ++--
src/include/c.h | 4 +-
28 files changed, 127 insertions(+), 124 deletions(-)
diff --git a/contrib/pax_storage/src/cpp/access/pax_access_handle.cc
b/contrib/pax_storage/src/cpp/access/pax_access_handle.cc
index da07cddd5d7..d73ecdb35a8 100644
--- a/contrib/pax_storage/src/cpp/access/pax_access_handle.cc
+++ b/contrib/pax_storage/src/cpp/access/pax_access_handle.cc
@@ -264,7 +264,7 @@ TM_Result CCPaxAccessMethod::TupleUpdate(Relation relation,
ItemPointer otid,
Snapshot snapshot, Snapshot
crosscheck,
bool wait, TM_FailureData *tmfd,
LockTupleMode *lockmode,
- bool *update_indexes) {
+
TU_UpdateIndexes *update_indexes) {
CBDB_TRY();
{
MemoryContext old_ctx;
@@ -276,7 +276,7 @@ TM_Result CCPaxAccessMethod::TupleUpdate(Relation relation,
ItemPointer otid,
crosscheck, wait, tmfd, lockmode,
update_indexes);
MemoryContextSwitchTo(old_ctx);
- if (result == TM_Ok) pgstat_count_heap_update(relation, false);
+ if (result == TM_Ok) pgstat_count_heap_update(relation, false, false);
return result;
}
CBDB_CATCH_DEFAULT();
@@ -765,7 +765,7 @@ static const TableAmRoutine kPaxColumnMethods = {
.tuple_lock = paxc::PaxAccessMethod::TupleLock,
.finish_bulk_insert = pax::CCPaxAccessMethod::FinishBulkInsert,
- .relation_set_new_filenode =
pax::CCPaxAccessMethod::RelationSetNewFilenode,
+ .relation_set_new_filelocator =
pax::CCPaxAccessMethod::RelationSetNewFilenode,
.relation_nontransactional_truncate =
pax::CCPaxAccessMethod::RelationNontransactionalTruncate,
.relation_copy_data = pax::CCPaxAccessMethod::RelationCopyData,
diff --git a/contrib/pax_storage/src/cpp/access/pax_access_handle.h
b/contrib/pax_storage/src/cpp/access/pax_access_handle.h
index d541a400d2b..8338e10f81f 100644
--- a/contrib/pax_storage/src/cpp/access/pax_access_handle.h
+++ b/contrib/pax_storage/src/cpp/access/pax_access_handle.h
@@ -152,9 +152,9 @@ class CCPaxAccessMethod final {
TupleTableSlot *slot, CommandId cid,
Snapshot snapshot, Snapshot crosscheck,
bool wait, TM_FailureData *tmfd,
- LockTupleMode *lockmode, bool *update_indexes);
+ LockTupleMode *lockmode, TU_UpdateIndexes
*update_indexes);
- static void RelationCopyData(Relation rel, const RelFileNode *newrnode);
+ static void RelationCopyData(Relation rel, const RelFileLocator *newrnode);
static void RelationCopyForCluster(Relation old_heap, Relation new_heap,
Relation old_index, bool use_sort,
@@ -164,7 +164,8 @@ class CCPaxAccessMethod final {
double *num_tuples, double *tups_vacuumed,
double *tups_recently_dead);
- static void RelationSetNewFilenode(Relation rel, const RelFileNode *newrnode,
+ static void RelationSetNewFilenode(Relation rel,
+ const
RelFileLocator *newrlocator,
char persistence,
TransactionId *freeze_xid,
MultiXactId *minmulti);
diff --git a/contrib/pax_storage/src/cpp/access/pax_access_method_internal.cc
b/contrib/pax_storage/src/cpp/access/pax_access_method_internal.cc
index f0f757e2180..91cdda0a2e2 100644
--- a/contrib/pax_storage/src/cpp/access/pax_access_method_internal.cc
+++ b/contrib/pax_storage/src/cpp/access/pax_access_method_internal.cc
@@ -189,7 +189,7 @@ void PaxAccessMethod::SwapRelationFiles(Oid relid1, Oid
relid2,
namespace pax {
void CCPaxAccessMethod::RelationSetNewFilenode(Relation rel,
- const RelFileNode *newrnode,
+ const RelFileLocator
*newrlocator,
char persistence,
TransactionId *freeze_xid,
MultiXactId *minmulti) {
@@ -241,22 +241,22 @@ void CCPaxAccessMethod::RelationSetNewFilenode(Relation
rel,
table_close(pax_tables_rel, NoLock);
// create relfilenode file for pax table
- auto srel = paxc::PaxRelationCreateStorage(*newrnode, rel);
+ auto srel = paxc::PaxRelationCreateStorage(*newrlocator, rel);
smgrclose(srel);
// create data directory
CBDB_TRY();
{
FileSystem *fs = pax::Singleton<LocalFileSystem>::GetInstance();
- auto path = cbdb::BuildPaxDirectoryPath(*newrnode, rel->rd_backend);
+ auto path = cbdb::BuildPaxDirectoryPath(*newrlocator, rel->rd_backend);
Assert(!path.empty());
CBDB_CHECK(
(fs->CreateDirectory(path) == 0),
cbdb::CException::ExType::kExTypeIOError,
fmt("Create directory failed [path=%s, errno=%d], "
"relfilenode [spcNode=%u, dbNode=%u, relNode=%u, backend=%d]",
- path.c_str(), errno, newrnode->spcNode, newrnode->dbNode,
- newrnode->relNode, rel->rd_backend));
+ path.c_str(), errno, newrlocator->spcOid,
newrlocator->dbOid,
+ newrlocator->relNumber, rel->rd_backend));
}
CBDB_CATCH_DEFAULT();
CBDB_FINALLY({});
@@ -277,7 +277,7 @@ void
CCPaxAccessMethod::RelationNontransactionalTruncate(Relation rel) {
}
void CCPaxAccessMethod::RelationCopyData(Relation rel,
- const RelFileNode *newrnode) {
+ const RelFileLocator *newrnode) {
CBDB_TRY();
{
cbdb::RelOpenSmgr(rel);
diff --git a/contrib/pax_storage/src/cpp/access/pax_deleter.cc
b/contrib/pax_storage/src/cpp/access/pax_deleter.cc
index 7869a7842ec..79c9bd43251 100644
--- a/contrib/pax_storage/src/cpp/access/pax_deleter.cc
+++ b/contrib/pax_storage/src/cpp/access/pax_deleter.cc
@@ -119,7 +119,7 @@ std::unique_ptr<IteratorBase<MicroPartitionMetadata>>
CPaxDeleter::BuildDeleteIterator() {
std::vector<pax::MicroPartitionMetadata> micro_partitions;
auto rel_path = cbdb::BuildPaxDirectoryPath(
- rel_->rd_node, rel_->rd_backend);
+ rel_->rd_locator, rel_->rd_backend);
for (auto &it : block_bitmap_map_) {
std::string block_id = std::to_string(it.first);
{
diff --git a/contrib/pax_storage/src/cpp/access/pax_scanner.cc
b/contrib/pax_storage/src/cpp/access/pax_scanner.cc
index a5e0b632002..21f485c3730 100644
--- a/contrib/pax_storage/src/cpp/access/pax_scanner.cc
+++ b/contrib/pax_storage/src/cpp/access/pax_scanner.cc
@@ -112,7 +112,7 @@ PaxIndexScanDesc::PaxIndexScanDesc(Relation rel) :
base_{.rel = rel} {
Assert(rel);
Assert(&base_ == reinterpret_cast<IndexFetchTableData *>(this));
rel_path_ = cbdb::BuildPaxDirectoryPath(
- rel->rd_node, rel->rd_backend);
+ rel->rd_locator, rel->rd_backend);
}
PaxIndexScanDesc::~PaxIndexScanDesc() {}
diff --git a/contrib/pax_storage/src/cpp/access/pax_updater.cc
b/contrib/pax_storage/src/cpp/access/pax_updater.cc
index 57776e732ff..549034accc6 100644
--- a/contrib/pax_storage/src/cpp/access/pax_updater.cc
+++ b/contrib/pax_storage/src/cpp/access/pax_updater.cc
@@ -36,7 +36,7 @@ TM_Result CPaxUpdater::UpdateTuple(
const Relation relation, const ItemPointer otid, TupleTableSlot *slot,
const CommandId cid, const Snapshot snapshot, const Snapshot
/*crosscheck*/,
const bool /*wait*/, TM_FailureData * tmfd,
- LockTupleMode * lockmode, bool *update_indexes) {
+ LockTupleMode * lockmode, TU_UpdateIndexes *update_indexes) {
TM_Result result;
auto dml_state = CPaxDmlStateLocal::Instance();
@@ -51,12 +51,12 @@ TM_Result CPaxUpdater::UpdateTuple(
if (result == TM_Ok) {
inserter->InsertTuple(relation, slot, cid, 0, nullptr);
- *update_indexes = true;
+ *update_indexes = TU_All;
} else {
// FIXME: set tmfd correctly.
// FYI, ao ignores both tmfd and lockmode
tmfd->ctid = *otid;
- *update_indexes = false;
+ *update_indexes = TU_None;
}
// TODO(gongxun): update pgstat info
return result;
diff --git a/contrib/pax_storage/src/cpp/access/pax_updater.h
b/contrib/pax_storage/src/cpp/access/pax_updater.h
index a498b5f7c70..53cf38090f9 100644
--- a/contrib/pax_storage/src/cpp/access/pax_updater.h
+++ b/contrib/pax_storage/src/cpp/access/pax_updater.h
@@ -37,6 +37,6 @@ class CPaxUpdater final {
const Snapshot snapshot,
const Snapshot crosscheck, const bool wait,
TM_FailureData *tmfd, LockTupleMode *lockmode,
- bool *update_indexes);
+ TU_UpdateIndexes
*update_indexes);
};
} // namespace pax
diff --git a/contrib/pax_storage/src/cpp/access/pax_visimap.cc
b/contrib/pax_storage/src/cpp/access/pax_visimap.cc
index b96752d31ba..5f828d2de85 100644
--- a/contrib/pax_storage/src/cpp/access/pax_visimap.cc
+++ b/contrib/pax_storage/src/cpp/access/pax_visimap.cc
@@ -138,7 +138,7 @@ std::shared_ptr<std::vector<uint8>> LoadVisimap(
bool TestVisimap(Relation rel, const char *visimap_name, int offset) {
FileSystem *fs;
std::shared_ptr<FileSystemOptions> options;
- auto rel_path = cbdb::BuildPaxDirectoryPath(rel->rd_node, rel->rd_backend);
+ auto rel_path = cbdb::BuildPaxDirectoryPath(rel->rd_locator,
rel->rd_backend);
auto file_path = cbdb::BuildPaxFilePath(rel_path, visimap_name);
fs = Singleton<LocalFileSystem>::GetInstance();
diff --git a/contrib/pax_storage/src/cpp/catalog/pax_aux_table.cc
b/contrib/pax_storage/src/cpp/catalog/pax_aux_table.cc
index baca9efe47d..907ed35c788 100644
--- a/contrib/pax_storage/src/cpp/catalog/pax_aux_table.cc
+++ b/contrib/pax_storage/src/cpp/catalog/pax_aux_table.cc
@@ -492,13 +492,13 @@ void PaxAuxRelationSetNewFilenode(Oid aux_relid) {
ReindexParams reindex_params = {0};
aux_rel = relation_open(aux_relid, AccessExclusiveLock);
- RelationSetNewRelfilenode(aux_rel, aux_rel->rd_rel->relpersistence);
+ RelationSetNewRelfilenumber(aux_rel, aux_rel->rd_rel->relpersistence);
toastrelid = aux_rel->rd_rel->reltoastrelid;
if (OidIsValid(toastrelid)) {
Relation toast_rel;
toast_rel = relation_open(toastrelid, AccessExclusiveLock);
- RelationSetNewRelfilenode(toast_rel, toast_rel->rd_rel->relpersistence);
+ RelationSetNewRelfilenumber(toast_rel, toast_rel->rd_rel->relpersistence);
relation_close(toast_rel, NoLock);
}
@@ -630,7 +630,7 @@ static void FetchMicroPartitionAuxRowCallback(Datum
*values, bool *isnull,
auto ctx = reinterpret_cast<struct FetchMicroPartitionAuxRowContext *>(arg);
auto rel = ctx->rel;
auto rel_path = cbdb::BuildPaxDirectoryPath(
- rel->rd_node, rel->rd_backend);
+ rel->rd_locator, rel->rd_backend);
Assert(!isnull[ANUM_PG_PAX_BLOCK_TABLES_PTBLOCKNAME]);
{
@@ -738,24 +738,24 @@ void
CCPaxAuxTable::PaxAuxRelationNontransactionalTruncate(Relation rel) {
// Delete all micro partition file on non-transactional truncate but reserve
// top level PAX file directory.
PaxAuxRelationFileUnlink(
- rel->rd_node, rel->rd_backend, false,
+ rel->rd_locator, rel->rd_backend, false,
rel->rd_rel->relpersistence == RELPERSISTENCE_PERMANENT);
}
void CCPaxAuxTable::PaxAuxRelationCopyData(Relation rel,
- const RelFileNode *newrnode,
+ const RelFileLocator *newrnode,
bool createnewpath) {
PaxCopyAllDataFiles(rel, newrnode, createnewpath);
}
void CCPaxAuxTable::PaxAuxRelationCopyDataForCluster(Relation old_rel,
Relation new_rel) {
- PaxAuxRelationCopyData(old_rel, &new_rel->rd_node, false);
+ PaxAuxRelationCopyData(old_rel, &new_rel->rd_locator, false);
cbdb::PaxCopyPaxBlockEntry(old_rel, new_rel);
// TODO(Tony) : here need to implement PAX re-organize semantics logic.
}
-void CCPaxAuxTable::PaxAuxRelationFileUnlink(RelFileNode node,
+void CCPaxAuxTable::PaxAuxRelationFileUnlink(RelFileLocator node,
BackendId backend,
bool delete_topleveldir,
bool need_wal) {
diff --git a/contrib/pax_storage/src/cpp/catalog/pax_aux_table.h
b/contrib/pax_storage/src/cpp/catalog/pax_aux_table.h
index 40095649057..4a6e2c9f997 100644
--- a/contrib/pax_storage/src/cpp/catalog/pax_aux_table.h
+++ b/contrib/pax_storage/src/cpp/catalog/pax_aux_table.h
@@ -96,18 +96,18 @@ class CCPaxAuxTable final {
~CCPaxAuxTable() = delete;
static void PaxAuxRelationSetNewFilenode(Relation rel,
- const RelFileNode *newrnode,
+ const RelFileLocator *newrnode,
char persistence);
static void PaxAuxRelationNontransactionalTruncate(Relation rel);
- static void PaxAuxRelationCopyData(Relation rel, const RelFileNode *newrnode,
+ static void PaxAuxRelationCopyData(Relation rel, const RelFileLocator
*newrnode,
bool createnewpath = true);
static void PaxAuxRelationCopyDataForCluster(Relation old_rel,
Relation new_rel);
- static void PaxAuxRelationFileUnlink(RelFileNode node, BackendId backend,
+ static void PaxAuxRelationFileUnlink(RelFileLocator node, BackendId backend,
bool delete_topleveldir, bool need_wal);
};
diff --git a/contrib/pax_storage/src/cpp/catalog/pax_catalog.h
b/contrib/pax_storage/src/cpp/catalog/pax_catalog.h
index 9b1da99b2b1..742d35a3ab5 100644
--- a/contrib/pax_storage/src/cpp/catalog/pax_catalog.h
+++ b/contrib/pax_storage/src/cpp/catalog/pax_catalog.h
@@ -81,7 +81,7 @@ class PaxCatalogUpdater {
#endif
};
-void PaxCopyAllDataFiles(Relation rel, const RelFileNode *newrnode,
+void PaxCopyAllDataFiles(Relation rel, const RelFileLocator *newrnode,
bool createnewpath);
} // namespace pax
diff --git a/contrib/pax_storage/src/cpp/catalog/pax_manifest.cc
b/contrib/pax_storage/src/cpp/catalog/pax_manifest.cc
index eaf42c4d2cc..faa883fa709 100644
--- a/contrib/pax_storage/src/cpp/catalog/pax_manifest.cc
+++ b/contrib/pax_storage/src/cpp/catalog/pax_manifest.cc
@@ -88,7 +88,7 @@ void CPaxCopyAllTuples(Relation old_rel, Relation new_rel,
Snapshot snapshot) {
} // namespace paxc
namespace pax {
-void PaxCopyAllDataFiles(Relation rel, const RelFileNode *newrnode,
+void PaxCopyAllDataFiles(Relation rel, const RelFileLocator *newrnode,
bool createnewpath) {
std::string src_path;
std::string dst_path;
@@ -97,7 +97,7 @@ void PaxCopyAllDataFiles(Relation rel, const RelFileNode
*newrnode,
Assert(rel && newrnode);
FileSystem *fs = pax::Singleton<LocalFileSystem>::GetInstance();
- src_path = cbdb::BuildPaxDirectoryPath(rel->rd_node, rel->rd_backend);
+ src_path = cbdb::BuildPaxDirectoryPath(rel->rd_locator, rel->rd_backend);
Assert(!src_path.empty());
dst_path =
@@ -109,9 +109,9 @@ void PaxCopyAllDataFiles(Relation rel, const RelFileNode
*newrnode,
fmt("Fail to build directory path. "
"src [spcNode=%u, dbNode=%u, relNode=%u, backend=%d]"
"dst [spcNode=%u, dbNode=%u, relNode=%u, backend=%d]",
- rel->rd_node.spcNode, rel->rd_node.dbNode,
- rel->rd_node.relNode, rel->rd_backend, newrnode->spcNode,
- newrnode->dbNode, newrnode->relNode, rel->rd_backend));
+ rel->rd_locator.spcOid, rel->rd_locator.dbOid,
+ rel->rd_locator.relNumber, rel->rd_backend, newrnode->spcOid,
+ newrnode->dbOid, newrnode->relNumber, rel->rd_backend));
// createnewpath is used to indicate if creating destination micropartition
// file directory and storage file for copying or not.
diff --git a/contrib/pax_storage/src/cpp/comm/cbdb_wrappers.cc
b/contrib/pax_storage/src/cpp/comm/cbdb_wrappers.cc
index b9d1a723028..de4a4678259 100644
--- a/contrib/pax_storage/src/cpp/comm/cbdb_wrappers.cc
+++ b/contrib/pax_storage/src/cpp/comm/cbdb_wrappers.cc
@@ -158,14 +158,14 @@ Datum cbdb::DatumFromPointer(const void *p, int16 typlen)
{
BpChar *cbdb::BpcharInput(const char *s, size_t len, int32 atttypmod) {
CBDB_WRAP_START;
- { return bpchar_input(s, len, atttypmod); }
+ { return bpchar_input(s, len, atttypmod, NULL); }
CBDB_WRAP_END;
return nullptr;
}
VarChar *cbdb::VarcharInput(const char *s, size_t len, int32 atttypmod) {
CBDB_WRAP_START;
- { return varchar_input(s, len, atttypmod); }
+ { return varchar_input(s, len, atttypmod, NULL); }
CBDB_WRAP_END;
return nullptr;
}
@@ -302,7 +302,7 @@ void cbdb::MakedirRecursive(const char *path) {
CBDB_WRAP_END;
}
-std::string cbdb::BuildPaxDirectoryPath(RelFileNode rd_node,
+std::string cbdb::BuildPaxDirectoryPath(RelFileLocator rd_node,
BackendId rd_backend) {
CBDB_WRAP_START;
{
@@ -390,7 +390,7 @@ static bool paxc_extractcolumns_walker( // NOLINT
return expression_tree_walker(
node,
- (bool (*)())(void (*)() /* to make -Wcast-function-type happy*/)(
+ (bool (*)(Node *node, void *context))(
paxc_extractcolumns_walker),
(void *)ec_ctx);
}
@@ -574,7 +574,7 @@ void cbdb::RelOpenSmgr(Relation rel) {
Assert(RelationIsPAX(rel));
if ((rel)->rd_smgr == NULL)
smgrsetowner(&((rel)->rd_smgr),
- smgropen((rel)->rd_node, (rel)->rd_backend, SMGR_PAX, rel));
+ smgropen((rel)->rd_locator, (rel)->rd_backend, SMGR_PAX,
rel));
}
CBDB_WRAP_END;
}
@@ -591,7 +591,7 @@ void cbdb::RelDropStorage(Relation rel) {
CBDB_WRAP_END;
}
-void cbdb::PaxRelationCreateStorage(RelFileNode rnode, Relation rel) {
+void cbdb::PaxRelationCreateStorage(RelFileLocator rnode, Relation rel) {
CBDB_WRAP_START;
{ paxc::PaxRelationCreateStorage(rnode, rel); }
CBDB_WRAP_END;
diff --git a/contrib/pax_storage/src/cpp/comm/cbdb_wrappers.h
b/contrib/pax_storage/src/cpp/comm/cbdb_wrappers.h
index 05738a4b2ab..f2726e4a97f 100644
--- a/contrib/pax_storage/src/cpp/comm/cbdb_wrappers.h
+++ b/contrib/pax_storage/src/cpp/comm/cbdb_wrappers.h
@@ -207,7 +207,7 @@ void PathNameDeleteDir(const char *path, bool
delete_topleveldir);
void MakedirRecursive(const char *path);
// gopher file path must start with '/', so we need to add '/' to the path
-std::string BuildPaxDirectoryPath(RelFileNode rd_node, BackendId rd_backend);
+std::string BuildPaxDirectoryPath(RelFileLocator rd_node, BackendId
rd_backend);
std::string BuildPaxFilePath(const char *rel_path, const char *block_id);
static inline std::string BuildPaxFilePath(const std::string &rel_path,
@@ -271,7 +271,7 @@ void RelOpenSmgr(Relation rel);
void RelCloseSmgr(Relation rel);
-void PaxRelationCreateStorage(RelFileNode rnode, Relation rel);
+void PaxRelationCreateStorage(RelFileLocator rnode, Relation rel);
void RelDropStorage(Relation rel);
diff --git a/contrib/pax_storage/src/cpp/comm/paxc_wrappers.cc
b/contrib/pax_storage/src/cpp/comm/paxc_wrappers.cc
index 175f4e39aaf..62d6633cb8f 100644
--- a/contrib/pax_storage/src/cpp/comm/paxc_wrappers.cc
+++ b/contrib/pax_storage/src/cpp/comm/paxc_wrappers.cc
@@ -96,10 +96,10 @@ void DeletePaxDirectoryPath(const char *dirname, bool
delete_topleveldir) {
// BuildPaxDirectoryPath: function used to build pax storage directory path
// following pg convension, for example base/{database_oid}/{blocks_relid}_pax.
-// parameter rd_node IN relfilenode information.
+// parameter rd_node IN relfilelocator information.
// parameter rd_backend IN backend transaction id.
// return palloc'd pax storage directory path.
-char *BuildPaxDirectoryPath(RelFileNode rd_node, BackendId rd_backend) {
+char *BuildPaxDirectoryPath(RelFileLocator rd_node, BackendId rd_backend) {
char *relpath = NULL;
char *paxrelpath = NULL;
relpath = relpathbackend(rd_node, rd_backend, MAIN_FORKNUM);
@@ -472,18 +472,19 @@ bool NeedWAL(Relation rel) {
/**
* @brief Create a directory for pax storage.
- * 1. Add pending delete for relfilenode/pax directory if abort transaction
- * 2. Add XLOG to create relfilenode/pax directory
- * 3. create relfilenode/pax directory, i.e. data directory.
+ * 1. Add pending delete for relfilelocator/pax directory if abort transaction
+ * 2. Add XLOG to create relfilelocator/pax directory
+ * 3. create relfilelocator/pax directory, i.e. data directory.
* This function will do following this function call
*/
-SMgrRelation PaxRelationCreateStorage(RelFileNode rnode, Relation rel)
+SMgrRelation PaxRelationCreateStorage(RelFileLocator rnode, Relation rel)
{
if (rel->rd_rel->relpersistence == RELPERSISTENCE_PERMANENT ||
rel->rd_rel->relpersistence == RELPERSISTENCE_UNLOGGED) {
paxc::XLogPaxCreateDirectory(rnode);
}
- return RelationCreateStorage(rnode, rel->rd_rel->relpersistence, SMGR_PAX,
rel);
+ return RelationCreateStorage(rnode, rel->rd_rel->relpersistence, false,
+ SMGR_PAX, rel);
}
} // namespace paxc
diff --git a/contrib/pax_storage/src/cpp/comm/paxc_wrappers.h
b/contrib/pax_storage/src/cpp/comm/paxc_wrappers.h
index cffa91f3418..607697c0902 100644
--- a/contrib/pax_storage/src/cpp/comm/paxc_wrappers.h
+++ b/contrib/pax_storage/src/cpp/comm/paxc_wrappers.h
@@ -33,7 +33,7 @@ namespace paxc {
// pax file operation, will refactor it later
void DeletePaxDirectoryPath(const char *dirname, bool delete_topleveldir);
void MakedirRecursive(const char *path);
-char *BuildPaxDirectoryPath(RelFileNode rd_node, BackendId rd_backend);
+char *BuildPaxDirectoryPath(RelFileLocator rd_node, BackendId rd_backend);
bool PGGetOperatorNo(Oid opno, NameData *oprname, Oid *oprleft, Oid *oprright,
FmgrInfo *finfo);
bool PGGetOperator(const char *operatorName, Oid operatorNamespace,
@@ -65,7 +65,7 @@ typedef struct PendingRelDeletePaxFile {
* deleted */
} PendingRelDeletePaxFile;
-SMgrRelation PaxRelationCreateStorage(RelFileNode rnode, Relation rel);
+SMgrRelation PaxRelationCreateStorage(RelFileLocator rnode, Relation rel);
} // namespace paxc
diff --git a/contrib/pax_storage/src/cpp/storage/micro_partition.h
b/contrib/pax_storage/src/cpp/storage/micro_partition.h
index 8c71cfbd574..6c54619131e 100644
--- a/contrib/pax_storage/src/cpp/storage/micro_partition.h
+++ b/contrib/pax_storage/src/cpp/storage/micro_partition.h
@@ -55,7 +55,7 @@ class MicroPartitionWriter {
std::string block_id;
TupleDesc rel_tuple_desc = nullptr;
Oid rel_oid = InvalidOid;
- RelFileNode node;
+ RelFileLocator node;
bool need_wal = false;
std::vector<std::tuple<ColumnEncoding_Kind, int>> encoding_opts;
std::pair<ColumnEncoding_Kind, int> offsets_encoding_opts;
diff --git a/contrib/pax_storage/src/cpp/storage/micro_partition_iterator.cc
b/contrib/pax_storage/src/cpp/storage/micro_partition_iterator.cc
index 9c9a1f8c8cd..b15c2ebcc99 100644
--- a/contrib/pax_storage/src/cpp/storage/micro_partition_iterator.cc
+++ b/contrib/pax_storage/src/cpp/storage/micro_partition_iterator.cc
@@ -164,7 +164,7 @@ MicroPartitionMetadata MicroPartitionInfoIterator::Next() {
Assert(tuple);
tuple_ = nullptr;
- return std::move(ToValue(tuple));
+ return ToValue(tuple);
}
void MicroPartitionInfoIterator::Rewind() {
@@ -181,7 +181,7 @@ MicroPartitionInfoIterator::New(Relation pax_rel, Snapshot
snapshot) {
auto it = std::make_unique<MicroPartitionInfoIterator>(
pax_rel, snapshot,
cbdb::BuildPaxDirectoryPath(
- pax_rel->rd_node, pax_rel->rd_backend));
+ pax_rel->rd_locator, pax_rel->rd_backend));
it->Begin();
return it;
@@ -259,7 +259,7 @@ MicroPartitionInfoParallelIterator::New(Relation pax_rel,
Snapshot snapshot,
auto it = std::make_unique<MicroPartitionInfoParallelIterator>(
pax_rel, snapshot, pscan,
cbdb::BuildPaxDirectoryPath(
- pax_rel->rd_node, pax_rel->rd_backend));
+ pax_rel->rd_locator, pax_rel->rd_backend));
return it;
}
@@ -375,7 +375,7 @@ MicroPartitionMetadata
MicroPartitionInfoParallelIterator::Next() {
Assert(tuple);
tuple_ = nullptr;
- return std::move(ToValue(tuple));
+ return ToValue(tuple);
}
void MicroPartitionInfoParallelIterator::Rewind() {
diff --git a/contrib/pax_storage/src/cpp/storage/pax.cc
b/contrib/pax_storage/src/cpp/storage/pax.cc
index adc268c0102..90a66aed8c1 100644
--- a/contrib/pax_storage/src/cpp/storage/pax.cc
+++ b/contrib/pax_storage/src/cpp/storage/pax.cc
@@ -71,7 +71,8 @@ class IndexUpdaterInternal {
Assert(slot == slot_);
Assert(HasIndex());
auto recheck_index =
- ExecInsertIndexTuples(relinfo_, slot_, estate_, true, false, NULL,
NIL);
+ ExecInsertIndexTuples(relinfo_, slot_, estate_, true, false, NULL, NIL,
+ false);
list_free(recheck_index);
}
@@ -191,7 +192,7 @@ std::unique_ptr<MicroPartitionWriter>
TableWriter::CreateMicroPartitionWriter(
toast_file_path = GenToastFilePath(file_path);
options.rel_oid = relation_->rd_id;
- options.node = relation_->rd_node;
+ options.node = relation_->rd_locator;
// only permanent table should write wal
options.need_wal =
relation_->rd_rel->relpersistence == RELPERSISTENCE_PERMANENT;
@@ -262,7 +263,7 @@ void TableWriter::InitOptionsCaches() {
void TableWriter::Open() {
rel_path_ = cbdb::BuildPaxDirectoryPath(
- relation_->rd_node, relation_->rd_backend);
+ relation_->rd_locator, relation_->rd_backend);
InitOptionsCaches();
@@ -589,7 +590,7 @@ void TableDeleter::DeleteWithVisibilityMap(
std::unique_ptr<Bitmap8> visi_bitmap;
auto catalog_update = pax::PaxCatalogUpdater::Begin(rel_);
auto rel_path = cbdb::BuildPaxDirectoryPath(
- rel_->rd_node, rel_->rd_backend);
+ rel_->rd_locator, rel_->rd_backend);
min_max_col_idxs = cbdb::GetMinMaxColumnIndexes(rel_);
stats_updater_projection->SetColumnProjection(min_max_col_idxs,
@@ -654,7 +655,7 @@ void TableDeleter::DeleteWithVisibilityMap(
file_system_options_);
visimap_file->WriteN(raw.bitmap, raw.size);
if (need_wal_) {
- cbdb::XLogPaxInsert(rel_->rd_node, visimap_file_name, 0, raw.bitmap,
+ cbdb::XLogPaxInsert(rel_->rd_locator, visimap_file_name, 0, raw.bitmap,
raw.size);
}
visimap_file->Close();
diff --git a/contrib/pax_storage/src/cpp/storage/paxc_smgr.cc
b/contrib/pax_storage/src/cpp/storage/paxc_smgr.cc
index ab47fc9ce47..616a895f4f1 100644
--- a/contrib/pax_storage/src/cpp/storage/paxc_smgr.cc
+++ b/contrib/pax_storage/src/cpp/storage/paxc_smgr.cc
@@ -38,22 +38,22 @@ extern smgr_get_impl_hook_type smgr_get_impl_hook;
namespace paxc {
-static void mdunlink_pax(RelFileNodeBackend rnode, ForkNumber forkNumber,
+static void mdunlink_pax(RelFileLocatorBackend rnode, ForkNumber forkNumber,
bool isRedo) {
// remove the data directory of pax table
// FIXME(gongxun): can work well with dfs_tablespace
if (forkNumber == MAIN_FORKNUM) {
const char *path =
- paxc::BuildPaxDirectoryPath(rnode.node, rnode.backend);
+ paxc::BuildPaxDirectoryPath(rnode.locator, rnode.backend);
paxc::DeletePaxDirectoryPath(path, true);
if (isRedo) {
- paxc::XLogForgetRelation(rnode.node);
+ paxc::XLogForgetRelation(rnode.locator);
}
}
- // unlink the relfilenode file directly, mdunlink will not remove
- // the relfilenode file, only truncate it if isRedo is false.
+ // unlink the relfilelocator file directly, mdunlink will not remove
+ // the relfilelocator file, only truncate it if isRedo is false.
auto relpath = relpath(rnode, MAIN_FORKNUM);
auto ret = unlink(relpath);
if (ret == -1 && errno != ENOENT) {
diff --git a/contrib/pax_storage/src/cpp/storage/toast/pax_toast.cc
b/contrib/pax_storage/src/cpp/storage/toast/pax_toast.cc
index 3aa54e48ea5..53cae91813a 100644
--- a/contrib/pax_storage/src/cpp/storage/toast/pax_toast.cc
+++ b/contrib/pax_storage/src/cpp/storage/toast/pax_toast.cc
@@ -345,10 +345,10 @@ std::pair<Datum, std::shared_ptr<MemoryObject>>
pax_make_toast(
case TYPSTORAGE_EXTENDED: {
if (VARATT_CAN_MAKE_PAX_COMPRESSED_TOAST(d) &&
!VARATT_CAN_MAKE_PAX_EXTERNAL_TOAST(d)) {
- std::tie(result, mobj) = pax_make_compressed_toast(PointerGetDatum(d));
+ std::tie(result, mobj) = pax_make_compressed_toast(d);
} else if (VARATT_CAN_MAKE_PAX_EXTERNAL_TOAST(d)) {
std::tie(result, mobj) =
- pax_make_external_toast(PointerGetDatum(d), true);
+ pax_make_external_toast(d, true);
}
break;
}
@@ -356,13 +356,13 @@ std::pair<Datum, std::shared_ptr<MemoryObject>>
pax_make_toast(
if (VARATT_CAN_MAKE_PAX_EXTERNAL_TOAST(d)) {
// should not make compress toast here
std::tie(result, mobj) =
- pax_make_external_toast(PointerGetDatum(d), false);
+ pax_make_external_toast(d, false);
}
break;
}
case TYPSTORAGE_MAIN: {
if (VARATT_CAN_MAKE_PAX_COMPRESSED_TOAST(d)) {
- std::tie(result, mobj) = pax_make_compressed_toast(PointerGetDatum(d));
+ std::tie(result, mobj) = pax_make_compressed_toast(d);
}
break;
diff --git a/contrib/pax_storage/src/cpp/storage/wal/pax_wal.cc
b/contrib/pax_storage/src/cpp/storage/wal/pax_wal.cc
index d40b106af5e..0e37ede201a 100644
--- a/contrib/pax_storage/src/cpp/storage/wal/pax_wal.cc
+++ b/contrib/pax_storage/src/cpp/storage/wal/pax_wal.cc
@@ -33,20 +33,20 @@
namespace cbdb {
-void XLogPaxInsert(RelFileNode node, const char *filename, int64 offset,
+void XLogPaxInsert(RelFileLocator node, const char *filename, int64 offset,
void *buffer, int32 bufferLen) {
CBDB_WRAP_START;
{ paxc::XLogPaxInsert(node, filename, offset, buffer, bufferLen); }
CBDB_WRAP_END;
}
-void XLogPaxCreateDirectory(RelFileNode node) {
+void XLogPaxCreateDirectory(RelFileLocator node) {
CBDB_WRAP_START;
{ paxc::XLogPaxCreateDirectory(node); }
CBDB_WRAP_END;
}
-void XLogPaxTruncate(RelFileNode node) {
+void XLogPaxTruncate(RelFileLocator node) {
CBDB_WRAP_START;
{ paxc::XLogPaxTruncate(node); }
CBDB_WRAP_END;
diff --git a/contrib/pax_storage/src/cpp/storage/wal/pax_wal.h
b/contrib/pax_storage/src/cpp/storage/wal/pax_wal.h
index 552bf52b49b..373f8c058d4 100644
--- a/contrib/pax_storage/src/cpp/storage/wal/pax_wal.h
+++ b/contrib/pax_storage/src/cpp/storage/wal/pax_wal.h
@@ -31,11 +31,11 @@
namespace cbdb {
-void XLogPaxInsert(RelFileNode node, const char *filename, int64 offset,
+void XLogPaxInsert(RelFileLocator node, const char *filename, int64 offset,
void *buffer, int32 bufferLen);
-void XLogPaxCreateDirectory(RelFileNode node);
+void XLogPaxCreateDirectory(RelFileLocator node);
-void XLogPaxTruncate(RelFileNode node);
+void XLogPaxTruncate(RelFileLocator node);
} // namespace cbdb
\ No newline at end of file
diff --git a/contrib/pax_storage/src/cpp/storage/wal/paxc_desc.c
b/contrib/pax_storage/src/cpp/storage/wal/paxc_desc.c
index 3b0c3114b17..2d00ea07c40 100644
--- a/contrib/pax_storage/src/cpp/storage/wal/paxc_desc.c
+++ b/contrib/pax_storage/src/cpp/storage/wal/paxc_desc.c
@@ -69,8 +69,8 @@ void pax_rmgr_desc(StringInfo buf, XLogReaderState *record) {
appendStringInfo(buf,
"PAX_CREATE_DIRECTORY, dbid = %u, spcId = %u, "
"relfilenodeid = %u",
- xlrec->node.dbNode, xlrec->node.spcNode,
- xlrec->node.relNode);
+ xlrec->node.dbOid, xlrec->node.spcOid,
+ xlrec->node.relNumber);
break;
}
case XLOG_PAX_TRUNCATE: {
@@ -78,8 +78,8 @@ void pax_rmgr_desc(StringInfo buf, XLogReaderState *record) {
appendStringInfo(buf,
"PAX_TRUNCATE, dbid = %u, spcId = %u, "
"relfilenodeid = %u",
- xlrec->node.dbNode, xlrec->node.spcNode,
- xlrec->node.relNode);
+ xlrec->node.dbOid, xlrec->node.spcOid,
+ xlrec->node.relNumber);
break;
}
default:
diff --git a/contrib/pax_storage/src/cpp/storage/wal/paxc_desc.h
b/contrib/pax_storage/src/cpp/storage/wal/paxc_desc.h
index 3ddcf67bdd2..3740c38005f 100644
--- a/contrib/pax_storage/src/cpp/storage/wal/paxc_desc.h
+++ b/contrib/pax_storage/src/cpp/storage/wal/paxc_desc.h
@@ -36,7 +36,7 @@ extern "C" {
#include "access/xlogreader.h"
#include "lib/stringinfo.h"
-#include "storage/relfilenode.h"
+#include "storage/relfilelocator.h"
// FIXME(gongxun):
// there are three types of pax file, data file, toast file and visimap file,
@@ -55,7 +55,7 @@ extern "C" {
#define XLOG_PAX_TRUNCATE 0x20
typedef struct xl_pax_target {
- RelFileNode node;
+ RelFileLocator node;
uint16 file_name_len;
int64 offset;
} xl_pax_target;
@@ -66,7 +66,7 @@ typedef struct xl_pax_target {
* layout of the pax insert:
*
* +-----------------+
- * | RelFileNode |
+ * | RelFileLocator |
* +-----------------+
* | file_name_len |
* +-----------------+
@@ -89,11 +89,11 @@ typedef struct xl_pax_insert {
* layout of the pax directory:
*
* +-----------------+
- * | RelFileNode |
+ * | RelFileLocator |
* +-----------------+
*/
typedef struct xl_pax_directory {
- RelFileNode node;
+ RelFileLocator node;
} xl_pax_directory;
#define SizeOfPAXDirectory sizeof(xl_pax_directory)
diff --git a/contrib/pax_storage/src/cpp/storage/wal/paxc_wal.cc
b/contrib/pax_storage/src/cpp/storage/wal/paxc_wal.cc
index dd746e32177..9b345dcf4f3 100644
--- a/contrib/pax_storage/src/cpp/storage/wal/paxc_wal.cc
+++ b/contrib/pax_storage/src/cpp/storage/wal/paxc_wal.cc
@@ -42,7 +42,7 @@ extern bool ignore_invalid_pages;
namespace paxc {
typedef struct xl_invalid_pax_file_key {
- RelFileNode node; /* the relation */
+ RelFileLocator node; /* the relation */
char filename[MAX_PATH_FILE_NAME_LEN];
} xl_invalid_pax_file_key;
@@ -58,7 +58,7 @@ static HTAB *invalid_pax_file_tab = NULL;
uint32 pax_file_key_hash(const void *key, Size keysize) {
xl_invalid_pax_file_key *pax_file_key = (xl_invalid_pax_file_key *)key;
return hash_any((const unsigned char *)key,
- sizeof(RelFileNode) + strlen(pax_file_key->filename));
+ sizeof(RelFileLocator) + strlen(pax_file_key->filename));
}
/*
@@ -69,12 +69,12 @@ int pax_file_key_compare(const void *key1, const void
*key2, Size keysize) {
xl_invalid_pax_file_key *pax_file_key1 = (xl_invalid_pax_file_key *)key1;
xl_invalid_pax_file_key *pax_file_key2 = (xl_invalid_pax_file_key *)key2;
- return !(RelFileNodeEquals(pax_file_key1->node, pax_file_key2->node) &&
+ return !(RelFileLocatorEquals(pax_file_key1->node, pax_file_key2->node) &&
strncmp(pax_file_key1->filename, pax_file_key2->filename,
MAX_PATH_FILE_NAME_LEN) == 0);
}
-static void LogInvalidPaxFile(RelFileNode node, const char *filename) {
+static void LogInvalidPaxFile(RelFileLocator node, const char *filename) {
xl_invalid_pax_file_key key;
bool found;
@@ -100,12 +100,12 @@ static void LogInvalidPaxFile(RelFileNode node, const
char *filename) {
hash_search(invalid_pax_file_tab, (void *)&key, HASH_ENTER, &found);
}
-void LogInvalidPaxDirctory(RelFileNode node) {
+void LogInvalidPaxDirctory(RelFileLocator node) {
// mark the directory as invalid, filename is empty
LogInvalidPaxFile(node, "");
}
-bool IsPaxDirectoryValid(RelFileNode node) {
+bool IsPaxDirectoryValid(RelFileLocator node) {
xl_invalid_pax_file hentry;
if (invalid_pax_file_tab == NULL) return true; /* nothing to do */
@@ -118,7 +118,7 @@ bool IsPaxDirectoryValid(RelFileNode node) {
return !found;
}
-void XLogForgetInvalidPaxFile(RelFileNode node, const char *filename) {
+void XLogForgetInvalidPaxFile(RelFileLocator node, const char *filename) {
xl_invalid_pax_file hentry;
if (invalid_pax_file_tab == NULL) return; /* nothing to do */
@@ -131,16 +131,16 @@ void XLogForgetInvalidPaxFile(RelFileNode node, const
char *filename) {
if (found) {
PAX_LOG_IF(pax::pax_enable_debug,
"forget invalid pax file, node: %u/%u/%u, filename: %s",
- node.dbNode, node.spcNode, node.relNode, filename);
+ node.dbOid, node.spcOid, node.relNumber, filename);
} else {
PAX_LOG_IF(
pax::pax_enable_debug,
"forget invalid pax file not found, node: %u/%u/%u, filename: %s",
- node.dbNode, node.spcNode, node.relNode, filename);
+ node.dbOid, node.spcOid, node.relNumber, filename);
}
}
-void XLogForgetRelation(RelFileNode node) {
+void XLogForgetRelation(RelFileLocator node) {
HASH_SEQ_STATUS status;
xl_invalid_pax_file *hentry;
@@ -149,7 +149,7 @@ void XLogForgetRelation(RelFileNode node) {
hash_seq_init(&status, invalid_pax_file_tab);
while ((hentry = (xl_invalid_pax_file *)hash_seq_search(&status)) != NULL) {
- if (RelFileNodeEquals(hentry->key.node, node)) {
+ if (RelFileLocatorEquals(hentry->key.node, node)) {
if (hash_search(invalid_pax_file_tab, (void *)&hentry->key, HASH_REMOVE,
NULL) == NULL) {
elog(ERROR, "hash table corrupted");
@@ -167,7 +167,7 @@ void XLogForgetDatabase(Oid dbId) {
hash_seq_init(&status, invalid_pax_file_tab);
PAX_LOG_IF(pax::pax_enable_debug, "forget database, dbid: %u", dbId);
while ((hentry = (xl_invalid_pax_file *)hash_seq_search(&status)) != NULL) {
- if (hentry->key.node.dbNode == dbId) {
+ if (hentry->key.node.dbOid == dbId) {
if (hash_search(invalid_pax_file_tab, (void *)&hentry->key, HASH_REMOVE,
NULL) == NULL) {
elog(ERROR, "hash table corrupted");
@@ -187,8 +187,8 @@ void XLogConsistencyCheck() {
hash_seq_init(&status, invalid_pax_file_tab);
while ((hentry = (xl_invalid_pax_file *)hash_seq_search(&status)) != NULL) {
elog(WARNING, "pax file is invalid, node: %u/%u/%u, filename: %s",
- hentry->key.node.dbNode, hentry->key.node.spcNode,
- hentry->key.node.relNode, hentry->key.filename);
+ hentry->key.node.dbOid, hentry->key.node.spcOid,
+ hentry->key.node.relNumber, hentry->key.filename);
foundone = true;
}
@@ -201,7 +201,7 @@ void XLogConsistencyCheck() {
invalid_pax_file_tab = NULL;
}
-void XLogPaxInsert(RelFileNode node, const char *filename, int64 offset,
+void XLogPaxInsert(RelFileLocator node, const char *filename, int64 offset,
void *buffer, int32 bufferLen) {
int file_name_len = strlen(filename);
@@ -229,7 +229,7 @@ void XLogPaxInsert(RelFileNode node, const char *filename,
int64 offset,
"pax xlog insert, node: %u/%u/%u,filename: %s, offset: %ld, "
"bufferLen: %d, "
"xlog_ptr: %X/%X",
- node.dbNode, node.spcNode, node.relNode, filename, offset,
+ node.dbOid, node.spcOid, node.relNumber, filename, offset,
bufferLen, (uint32)(lsn >> 32), (uint32)lsn);
// FIXME(gongxun): we should wait for mirror here,copy from xlog_ao_insert
@@ -237,7 +237,7 @@ void XLogPaxInsert(RelFileNode node, const char *filename,
int64 offset,
wait_to_avoid_large_repl_lag();
}
-void XLogPaxCreateDirectory(RelFileNode node) {
+void XLogPaxCreateDirectory(RelFileLocator node) {
xl_pax_directory xlrec;
xlrec.node = node;
@@ -248,11 +248,11 @@ void XLogPaxCreateDirectory(RelFileNode node) {
XLogRecPtr lsn = XLogInsert(PAX_RMGR_ID, XLOG_PAX_CREATE_DIRECTORY);
PAX_LOG_IF(pax::pax_enable_debug,
"pax xlog create directory, node: %u/%u/%u, xlog_ptr: %X/%X",
- node.dbNode, node.spcNode, node.relNode, (uint32)(lsn >> 32),
+ node.dbOid, node.spcOid, node.relNumber, (uint32)(lsn >> 32),
(uint32)lsn);
}
-void XLogPaxTruncate(RelFileNode node) {
+void XLogPaxTruncate(RelFileLocator node) {
xl_pax_directory xlrec;
xlrec.node = node;
@@ -264,7 +264,7 @@ void XLogPaxTruncate(RelFileNode node) {
XLogRecPtr lsn = XLogInsert(PAX_RMGR_ID, XLOG_PAX_TRUNCATE);
PAX_LOG_IF(pax::pax_enable_debug,
"pax xlog truncate, node: %u/%u/%u, xlog_ptr: %X/%X",
- node.dbNode, node.spcNode, node.relNode, (uint32)(lsn >> 32),
+ node.dbOid, node.spcOid, node.relNumber, (uint32)(lsn >> 32),
(uint32)lsn);
}
@@ -297,8 +297,8 @@ void XLogRedoPaxInsert(XLogReaderState *record) {
PAX_LOG_IF(pax::pax_enable_debug,
"pax xlog redo insert, node: %u/%u/%u, offset: %ld, "
"path: %s",
- xlrec->target.node.dbNode, xlrec->target.node.spcNode,
- xlrec->target.node.relNode, xlrec->target.offset, path);
+ xlrec->target.node.dbOid, xlrec->target.node.spcOid,
+ xlrec->target.node.relNumber, xlrec->target.offset, path);
char *buffer = (char *)xlrec + SizeOfPAXInsert + xlrec->target.file_name_len;
int32 bufferLen =
XLogRecGetDataLen(record) - SizeOfPAXInsert -
xlrec->target.file_name_len;
@@ -313,8 +313,8 @@ void XLogRedoPaxInsert(XLogReaderState *record) {
if (errno == ENOENT) {
PAX_LOG_IF(pax::pax_enable_debug,
"directory not exists, node: %u/%u/%u, path: %s",
- xlrec->target.node.dbNode, xlrec->target.node.spcNode,
- xlrec->target.node.relNode, path);
+ xlrec->target.node.dbOid, xlrec->target.node.spcOid,
+ xlrec->target.node.relNumber, path);
LogInvalidPaxDirctory(xlrec->target.node);
} else {
ereport(ignore_invalid_pages ? WARNING : PANIC,
@@ -347,8 +347,8 @@ void XLogRedoPaxInsert(XLogReaderState *record) {
if (errno == ENOENT) {
PAX_LOG_IF(pax::pax_enable_debug,
"file not exists, node: %u/%u/%u, path: %s",
- xlrec->target.node.dbNode, xlrec->target.node.spcNode,
- xlrec->target.node.relNode, path);
+ xlrec->target.node.dbOid, xlrec->target.node.spcOid,
+ xlrec->target.node.relNumber, path);
LogInvalidPaxFile(xlrec->target.node, path);
} else {
ereport(
@@ -378,18 +378,18 @@ void XLogRedoPaxCreateDirectory(XLogReaderState *record) {
char *rec = XLogRecGetData(record);
xl_pax_directory *xlrec = (xl_pax_directory *)rec;
- TablespaceCreateDbspace(xlrec->node.spcNode, xlrec->node.dbNode, true);
+ TablespaceCreateDbspace(xlrec->node.spcOid, xlrec->node.dbOid, true);
dirpath = paxc::BuildPaxDirectoryPath(xlrec->node, InvalidBackendId);
PAX_LOG_IF(pax::pax_enable_debug,
"pax xlog redo create directory, node: %u/%u/%u, dirpath: %s",
- xlrec->node.dbNode, xlrec->node.spcNode, xlrec->node.relNode,
+ xlrec->node.dbOid, xlrec->node.spcOid, xlrec->node.relNumber,
dirpath);
// Like mdcreate, we need to create the directory for pax storage.
// We may be using the target table space for the first time in this
// database, so create a per-database subdirectory if needed.
- TablespaceCreateDbspace(xlrec->node.spcNode, xlrec->node.dbNode, true);
+ TablespaceCreateDbspace(xlrec->node.spcOid, xlrec->node.dbOid, true);
int ret = MakePGDirectory(dirpath);
if (ret != 0) {
@@ -397,7 +397,7 @@ void XLogRedoPaxCreateDirectory(XLogReaderState *record) {
if (errno == EEXIST) {
PAX_LOG_IF(pax::pax_enable_debug,
"directory already exists, node: %u/%u/%u, dirpath: %s",
- xlrec->node.dbNode, xlrec->node.spcNode, xlrec->node.relNode,
+ xlrec->node.dbOid, xlrec->node.spcOid, xlrec->node.relNumber,
dirpath);
} else {
ereport(ignore_invalid_pages ? WARNING : PANIC,
@@ -416,7 +416,7 @@ void XLogRedoPaxTruncate(XLogReaderState *record) {
PAX_LOG_IF(pax::pax_enable_debug,
"pax xlog redo truncate, node: %u/%u/%u, dirpath: %s",
- xlrec->node.dbNode, xlrec->node.spcNode, xlrec->node.relNode,
+ xlrec->node.dbOid, xlrec->node.spcOid, xlrec->node.relNumber,
dirpath);
paxc::DeletePaxDirectoryPath(dirpath, false);
diff --git a/contrib/pax_storage/src/cpp/storage/wal/paxc_wal.h
b/contrib/pax_storage/src/cpp/storage/wal/paxc_wal.h
index 6b2fc88e8e9..7833aa5d9f9 100644
--- a/contrib/pax_storage/src/cpp/storage/wal/paxc_wal.h
+++ b/contrib/pax_storage/src/cpp/storage/wal/paxc_wal.h
@@ -39,18 +39,18 @@ extern "C" {
namespace paxc {
void RegisterPaxRmgr();
-void XLogPaxInsert(RelFileNode node, const char *filename, int64 offset,
+void XLogPaxInsert(RelFileLocator node, const char *filename, int64 offset,
void *buffer, int32 bufferLen);
-void XLogPaxCreateDirectory(RelFileNode node);
+void XLogPaxCreateDirectory(RelFileLocator node);
-void XLogPaxTruncate(RelFileNode node);
+void XLogPaxTruncate(RelFileLocator node);
void XLogConsistencyCheck();
-void XLogForgetInvalidPaxFile(RelFileNode node, const char *filename);
+void XLogForgetInvalidPaxFile(RelFileLocator node, const char *filename);
-void XLogForgetRelation(RelFileNode node);
+void XLogForgetRelation(RelFileLocator node);
void XLogForgetDatabase(Oid dbId);
diff --git a/src/include/c.h b/src/include/c.h
index b789a8f31d3..326b0118e50 100644
--- a/src/include/c.h
+++ b/src/include/c.h
@@ -1410,8 +1410,8 @@ extern int fdatasync(int fildes);
* strtoimax()/strtoumax() which return intmax_t/uintmax_t.)
*/
#ifdef HAVE_LONG_INT_64
-#define strtoi64(str, endptr, base) ((int64) strtol(str, endptr, base))
-#define strtou64(str, endptr, base) ((uint64) strtoul(str, endptr, base))
+#define strtoi64(str, endptr, base) strtol(str, endptr, base)
+#define strtou64(str, endptr, base) strtoul(str, endptr, base)
#else
#define strtoi64(str, endptr, base) ((int64) strtoll(str, endptr, base))
#define strtou64(str, endptr, base) ((uint64) strtoull(str, endptr, base))
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]