Skip to content

Commit

Permalink
Fix drop node property test
Browse files Browse the repository at this point in the history
  • Loading branch information
acquamarin committed Mar 8, 2023
1 parent 947789a commit ba542fc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/include/common/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ struct BufferPoolConstants {
struct StorageConstants {
// The default amount of memory pre-allocated to both the default and large pages buffer pool.
static constexpr uint64_t DEFAULT_BUFFER_POOL_SIZE = 1ull << 30; // (1GB)
static constexpr uint64_t DEFAULT_BUFFER_POOL_SIZE_FOR_TESTING = 1ull << 26; // (64MB)
static constexpr uint64_t DEFAULT_BUFFER_POOL_SIZE_FOR_TESTING = 1ull << 27; // (128MB)
// The default ratio of system memory allocated to buffer pools (including default and large).
static constexpr double DEFAULT_BUFFER_POOL_RATIO = 0.8;
// The default ratio of buffer allocated to default and large pages.
Expand Down
4 changes: 2 additions & 2 deletions src/storage/buffer_manager/buffer_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ BufferPool::BufferPool(uint64_t pageSize, uint64_t maxSize)
numFrames((page_idx_t)(ceil((double)maxSize / (double)pageSize))) {
assert(pageSize == BufferPoolConstants::DEFAULT_PAGE_SIZE ||
pageSize == BufferPoolConstants::LARGE_PAGE_SIZE);
auto mmapRegion = (u_int8_t*)mmap(
auto mmapRegion = (uint8_t*)mmap(
NULL, (numFrames * pageSize), PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
for (auto i = 0u; i < numFrames; ++i) {
auto buffer = mmapRegion + (i * pageSize);
Expand All @@ -75,7 +75,7 @@ void BufferPool::resize(uint64_t newSize) {
auto newNumFrames = (page_idx_t)(ceil((double)newSize / (double)pageSize));
assert(newNumFrames < UINT32_MAX);
auto mmapRegion =
(u_int8_t*)mmap(NULL, newSize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
(uint8_t*)mmap(NULL, newSize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
for (auto i = 0u; i < newNumFrames - numFrames; ++i) {
auto buffer = mmapRegion + (i * pageSize);
bufferCache.emplace_back(std::make_unique<Frame>(pageSize, buffer));
Expand Down
6 changes: 3 additions & 3 deletions src/storage/wal_replayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,18 +353,18 @@ void WALReplayer::replayWALRecord(WALRecord& walRecord) {
auto propertyID = walRecord.dropPropertyRecord.propertyID;
if (!isRecovering) {
if (catalog->getReadOnlyVersion()->containNodeTable(tableID)) {
storageManager->getNodesStore().getNodeTable(tableID)->removeProperty(
propertyID);
WALReplayerUtils::removeDBFilesForNodeProperty(
wal->getDirectory(), tableID, propertyID);
storageManager->getNodesStore().getNodeTable(tableID)->removeProperty(
propertyID);
} else {
WALReplayerUtils::removeDBFilesForRelProperty(wal->getDirectory(),
catalog->getReadOnlyVersion()->getRelTableSchema(tableID), propertyID);
storageManager->getRelsStore().getRelTable(tableID)->removeProperty(
propertyID, *catalog->getReadOnlyVersion()->getRelTableSchema(tableID));
}
} else {
auto catalogForRecovery = getCatalogForRecovery(DBFileType::ORIGINAL);
auto catalogForRecovery = getCatalogForRecovery(DBFileType::WAL_VERSION);
if (catalogForRecovery->getReadOnlyVersion()->containNodeTable(tableID)) {
WALReplayerUtils::removeDBFilesForNodeProperty(
wal->getDirectory(), tableID, propertyID);
Expand Down

0 comments on commit ba542fc

Please sign in to comment.