mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-10 18:05:44 +02:00
chore: add more logs to the op_manager code (#4527)
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
parent
ffce1cb796
commit
fc94b2c265
4 changed files with 19 additions and 1 deletions
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
|
@ -171,7 +171,7 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
cd ${GITHUB_WORKSPACE}/build
|
cd ${GITHUB_WORKSPACE}/build
|
||||||
echo Run ctest -V -L DFLY
|
echo Run ctest -V -L DFLY
|
||||||
GLOG_alsologtostderr=1 GLOG_vmodule=rdb_load=1,rdb_save=1,snapshot=1 \
|
GLOG_alsologtostderr=1 GLOG_vmodule=rdb_load=1,rdb_save=1,snapshot=1,op_manager=1,op_manager_test=1 \
|
||||||
FLAGS_fiber_safety_margin=4096 FLAGS_list_experimental_v2=true timeout 20m ctest -V -L DFLY
|
FLAGS_fiber_safety_margin=4096 FLAGS_list_experimental_v2=true timeout 20m ctest -V -L DFLY
|
||||||
|
|
||||||
echo "Running tests with --force_epoll"
|
echo "Running tests with --force_epoll"
|
||||||
|
|
|
@ -42,6 +42,10 @@ struct DiskSegment {
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t offset = 0, length = 0;
|
size_t offset = 0, length = 0;
|
||||||
|
|
||||||
|
friend std::ostream& operator<<(std::ostream& os, const DiskSegment& ds) {
|
||||||
|
return os << "[" << ds.offset << ", " << ds.length << "]";
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
}; // namespace dfly::tiering
|
}; // namespace dfly::tiering
|
||||||
|
|
|
@ -28,6 +28,16 @@ OpManager::EntryId Borrowed(const OpManager::OwnedEntryId& id) {
|
||||||
return std::visit([](const auto& v) -> OpManager::EntryId { return v; }, id);
|
return std::visit([](const auto& v) -> OpManager::EntryId { return v; }, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::ostream& operator<<(std::ostream& os, const OpManager::EntryId& id) {
|
||||||
|
if (const auto* i = std::get_if<unsigned>(&id); i) {
|
||||||
|
return os << *i;
|
||||||
|
} else {
|
||||||
|
const auto& key = std::get<OpManager::KeyRef>(id);
|
||||||
|
return os << "(" << key.first << ':' << key.second << ")";
|
||||||
|
}
|
||||||
|
return os;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
OpManager::OpManager(size_t max_size) : storage_{max_size} {
|
OpManager::OpManager(size_t max_size) : storage_{max_size} {
|
||||||
|
@ -115,7 +125,10 @@ void OpManager::ProcessStashed(EntryId id, unsigned version,
|
||||||
NotifyStashed(id, segment);
|
NotifyStashed(id, segment);
|
||||||
} else if (segment) {
|
} else if (segment) {
|
||||||
// Throw away the value because it's no longer up-to-date even if no error occured
|
// Throw away the value because it's no longer up-to-date even if no error occured
|
||||||
|
VLOG(1) << "Releasing segment " << *segment << ", id: " << id;
|
||||||
storage_.MarkAsFree(*segment);
|
storage_.MarkAsFree(*segment);
|
||||||
|
} else {
|
||||||
|
LOG(ERROR) << "Stash failed with error " << segment.error();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,7 @@ struct OpManagerTest : PoolTestBase, OpManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
void NotifyStashed(EntryId id, const io::Result<DiskSegment>& segment) override {
|
void NotifyStashed(EntryId id, const io::Result<DiskSegment>& segment) override {
|
||||||
|
VLOG(1) << std::get<0>(id) << " stashed";
|
||||||
ASSERT_TRUE(segment);
|
ASSERT_TRUE(segment);
|
||||||
auto [it, inserted] = stashed_.emplace(id, *segment);
|
auto [it, inserted] = stashed_.emplace(id, *segment);
|
||||||
ASSERT_TRUE(inserted);
|
ASSERT_TRUE(inserted);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue