Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid use MAX_NAMESPACE_ID as kvstore's ns_id #4839

Merged
merged 5 commits into from
May 7, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion dbms/src/Storages/DeltaMerge/DeltaMergeStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1729,7 +1729,7 @@ UInt64 DeltaMergeStore::onSyncGc(Int64 limit)
}
}
if (!finish_gc_on_segment)
LOG_FMT_DEBUG(
LOG_FMT_TRACE(
log,
"GC is skipped Segment [{}] [range={}] [table={}]",
segment_id,
Expand Down
2 changes: 2 additions & 0 deletions dbms/src/Storages/Page/PageDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ static constexpr UInt64 MAX_PERSISTED_LOG_FILES = 4;

using NamespaceId = UInt64;
static constexpr NamespaceId MAX_NAMESPACE_ID = UINT64_MAX;
// KVStore stores it's data individually, so the actual `ns_id` value doesn't matter(just different from `MAX_NAMESPACE_ID` is enough)
static constexpr NamespaceId KVSTORE_NAMESPACE_ID = 1000000UL;
// just a random namespace id for test, the value doesn't matter
static constexpr NamespaceId TEST_NAMESPACE_ID = 1000;

Expand Down
3 changes: 1 addition & 2 deletions dbms/src/Storages/Transaction/RegionPersister.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ class RegionPersister final : private boost::noncopyable
PageStoragePtr page_storage;
std::shared_ptr<PS::V1::PageStorage> stable_page_storage;

// RegionPersister stores it's data individually, so the `ns_id` value doesn't matter
NamespaceId ns_id = MAX_NAMESPACE_ID;
NamespaceId ns_id = KVSTORE_NAMESPACE_ID;
const RegionManager & region_manager;
std::mutex mutex;
Poco::Logger * log;
Expand Down