chore: Remove TieringV1 (#2962)

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
This commit is contained in:
Vladislav 2024-04-26 11:01:05 +03:00 committed by GitHub
parent 8000220209
commit 82dd05fe30
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 34 additions and 1088 deletions

View file

@ -371,8 +371,9 @@ EngineShard::~EngineShard() {
void EngineShard::Shutdown() {
queue_.Shutdown();
if (tiered_storage_) {
tiered_storage_->Shutdown();
if (tiered_storage_v2_) {
tiered_storage_v2_->Close();
tiered_storage_v2_.reset();
}
fiber_periodic_done_.Notify();
@ -404,23 +405,11 @@ void EngineShard::InitThreadLocal(ProactorBase* pb, bool update_db_time, size_t
CompactObj::InitThreadLocal(shard_->memory_resource());
SmallString::InitThreadLocal(data_heap);
string backing_prefix = GetFlag(FLAGS_tiered_prefix);
if (!backing_prefix.empty()) {
if (pb->GetKind() != ProactorBase::IOURING) {
LOG(ERROR) << "Only ioring based backing storage is supported. Exiting...";
exit(1);
}
shard_->tiered_storage_.reset(new TieredStorage(&shard_->db_slice_, max_file_size));
error_code ec = shard_->tiered_storage_->Open(backing_prefix);
CHECK(!ec) << ec.message(); // TODO
}
if (string backing_prefix = GetFlag(FLAGS_tiered_prefix_v2); !backing_prefix.empty()) {
LOG_IF(FATAL, pb->GetKind() != ProactorBase::IOURING)
<< "Only ioring based backing storage is supported. Exiting...";
shard_->tiered_storage_v2_.reset(new TieredStorageV2{&shard_->db_slice_});
shard_->tiered_storage_v2_ = make_unique<TieredStorageV2>(&shard_->db_slice_);
error_code ec = shard_->tiered_storage_v2_->Open(backing_prefix);
CHECK(!ec) << ec.message();
}
@ -593,8 +582,7 @@ void EngineShard::Heartbeat() {
}
ssize_t eviction_redline = (max_memory_limit * kRedLimitFactor) / shard_set->size();
size_t tiering_redline =
(max_memory_limit * GetFlag(FLAGS_tiered_offload_threshold)) / shard_set->size();
DbContext db_cntx;
db_cntx.time_now_ms = GetCurrentTimeMs();
@ -615,14 +603,6 @@ void EngineShard::Heartbeat() {
if (db_slice_.memory_budget() < eviction_redline) {
db_slice_.FreeMemWithEvictionStep(i, eviction_redline - db_slice_.memory_budget());
}
if (tiered_storage_) {
size_t offload_bytes = 0;
if (UsedMemory() > tiering_redline) {
offload_bytes = UsedMemory() - tiering_redline;
}
db_slice_.ScheduleForOffloadStep(i, offload_bytes);
}
}
// Journal entries for expired entries are not writen to socket in the loop above.