Skip to content

Commit

Permalink
avoid use MAX_NAMESPACE_ID as kvstore's ns_id (#4839)
Browse files Browse the repository at this point in the history
ref #3594
  • Loading branch information
lidezhu authored May 7, 2022
1 parent 7ffb943 commit a1110d0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
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

0 comments on commit a1110d0

Please sign in to comment.