aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkungasc <kungasc@yandex-team.com>2023-06-22 11:47:04 +0300
committerkungasc <kungasc@yandex-team.com>2023-06-22 11:47:04 +0300
commit5030edd029bb4d87bc1fb6c8d7c7edfca202e91a (patch)
tree1ca19dcbfbe1c42802af90483f83ff5efa2d0aab
parent70d280ea06af3a6641e1c4abc876070a9daf6ff6 (diff)
downloadydb-5030edd029bb4d87bc1fb6c8d7c7edfca202e91a.tar.gz
Clean up private cache settings
-rw-r--r--ydb/core/protos/flat_scheme_op.proto2
-rw-r--r--ydb/core/tablet_flat/flat_dbase_scheme.h2
-rw-r--r--ydb/core/tablet_flat/flat_executor.cpp18
-rw-r--r--ydb/core/tablet_flat/flat_executor.h4
-rw-r--r--ydb/core/tablet_flat/flat_sausagecache.cpp11
-rw-r--r--ydb/core/tablet_flat/flat_sausagecache.h3
6 files changed, 3 insertions, 37 deletions
diff --git a/ydb/core/protos/flat_scheme_op.proto b/ydb/core/protos/flat_scheme_op.proto
index 2fe564b721..a7c6196a0a 100644
--- a/ydb/core/protos/flat_scheme_op.proto
+++ b/ydb/core/protos/flat_scheme_op.proto
@@ -259,7 +259,7 @@ message TPartitionConfig {
optional string NamedCompactionPolicy = 1; // One of the predefined policies
optional TCompactionPolicy CompactionPolicy = 2; // Customized policy
optional uint64 FollowerCount = 3;
- optional uint64 ExecutorCacheSize = 4; // Cache size for the whole tablet including all user and system tables
+ optional uint64 ExecutorCacheSize = 4; // (DEPRECATED) Cache size for the whole tablet including all user and system tables
optional bool AllowFollowerPromotion = 5 [default = true]; // if true followers can upgrade to leader, if false followers only handle reads
optional uint64 TxReadSizeLimit = 6; // Maximum size in bytes that is allowed to be read by a single Tx
//optional bool CrossDataCenterFollowers = 7; // deprecated -> CrossDataCenterFollowerCount
diff --git a/ydb/core/tablet_flat/flat_dbase_scheme.h b/ydb/core/tablet_flat/flat_dbase_scheme.h
index 85098da115..521ca85803 100644
--- a/ydb/core/tablet_flat/flat_dbase_scheme.h
+++ b/ydb/core/tablet_flat/flat_dbase_scheme.h
@@ -122,7 +122,7 @@ public:
};
struct TExecutorInfo {
- ui64 CacheSize = 384 * 1024;
+ ui64 CacheSize = 384 * 1024; // (DEPRECATED)
bool AllowLogBatching = false;
bool LogFastTactic = true;
TDuration LogFlushPeriod = TDuration::MicroSeconds(500);
diff --git a/ydb/core/tablet_flat/flat_executor.cpp b/ydb/core/tablet_flat/flat_executor.cpp
index 8e2a8ff93d..786d2beab8 100644
--- a/ydb/core/tablet_flat/flat_executor.cpp
+++ b/ydb/core/tablet_flat/flat_executor.cpp
@@ -145,8 +145,7 @@ void TExecutor::Broken() {
void TExecutor::RecreatePageCollectionsCache() noexcept
{
- TCacheCacheConfig cacheConfig(Scheme().Executor.CacheSize, CounterCacheFresh, CounterCacheStaging, CounterCacheWarm);
- PrivatePageCache = MakeHolder<TPrivatePageCache>(cacheConfig);
+ PrivatePageCache = MakeHolder<TPrivatePageCache>();
Stats->PacksMetaBytes = 0;
@@ -324,10 +323,6 @@ void TExecutor::ActivateFollower(const TActorContext &ctx) {
Y_VERIFY(!CompactionLogic);
- CounterCacheFresh = new NMonitoring::TCounterForPtr;
- CounterCacheStaging = new NMonitoring::TCounterForPtr;
- CounterCacheWarm = new NMonitoring::TCounterForPtr;
-
ResourceMetrics = MakeHolder<NMetrics::TResourceMetrics>(Owner->TabletID(), FollowerId, Launcher);
PendingBlobQueue.Config.TabletID = Owner->TabletID();
@@ -376,10 +371,6 @@ void TExecutor::Active(const TActorContext &ctx) {
Sprintf("tablet-%" PRIu64, Owner->TabletID())));
LogicRedo->InstallCounters(Counters.Get(), nullptr);
- CounterCacheFresh = new NMonitoring::TCounterForPtr;
- CounterCacheStaging = new NMonitoring::TCounterForPtr;
- CounterCacheWarm = new NMonitoring::TCounterForPtr;
-
ResourceMetrics = MakeHolder<NMetrics::TResourceMetrics>(Owner->TabletID(), 0, Launcher);
PendingBlobQueue.Config.TabletID = Owner->TabletID();
@@ -1888,7 +1879,6 @@ void TExecutor::CommitTransactionLog(TAutoPtr<TSeat> seat, TPageCollectionTxEnv
if (auto alter = std::move(change->Scheme)) {
LogicAlter->WriteLog(*commit, std::move(alter));
- PrivatePageCache->UpdateCacheSize(Scheme().Executor.CacheSize);
auto reflectResult = CompactionLogic->ReflectSchemeChanges();
ReadResourceProfile();
@@ -3399,9 +3389,6 @@ void TExecutor::UpdateCounters(const TActorContext &ctx) {
Counters->Simple()[TExecutorCounters::DB_INDEX_BYTES].Set(dbCounters.Parts.IndexBytes);
Counters->Simple()[TExecutorCounters::DB_OTHER_BYTES].Set(dbCounters.Parts.OtherBytes);
Counters->Simple()[TExecutorCounters::DB_BYKEY_BYTES].Set(dbCounters.Parts.ByKeyBytes);
- Counters->Simple()[TExecutorCounters::CACHE_FRESH_SIZE].Set(CounterCacheFresh->Val());
- Counters->Simple()[TExecutorCounters::CACHE_STAGING_SIZE].Set(CounterCacheStaging->Val());
- Counters->Simple()[TExecutorCounters::CACHE_WARM_SIZE].Set(CounterCacheWarm->Val());
Counters->Simple()[TExecutorCounters::USED_TABLET_MEMORY].Set(UsedTabletMemory);
}
@@ -3944,9 +3931,6 @@ void TExecutor::RenderHtmlPage(NMon::TEvRemoteHttpInfo::TPtr &ev) const {
CompactionLogic->OutputHtml(str, *scheme, cgi);
TAG(TH3) {str << "Page collection cache:";}
- DIV_CLASS("row") {str << "fresh bytes: " << CounterCacheFresh->Val(); }
- DIV_CLASS("row") {str << "staging bytes: " << CounterCacheStaging->Val(); }
- DIV_CLASS("row") {str << "warm bytes: " << CounterCacheWarm->Val(); }
DIV_CLASS("row") {str << "Total collections: " << PrivatePageCache->GetStats().TotalCollections; }
DIV_CLASS("row") {str << "Total bytes in shared cache: " << PrivatePageCache->GetStats().TotalSharedBody; }
DIV_CLASS("row") {str << "Total bytes in local cache: " << PrivatePageCache->GetStats().TotalPinnedBody; }
diff --git a/ydb/core/tablet_flat/flat_executor.h b/ydb/core/tablet_flat/flat_executor.h
index 26821dea7f..7e842f8d33 100644
--- a/ydb/core/tablet_flat/flat_executor.h
+++ b/ydb/core/tablet_flat/flat_executor.h
@@ -460,10 +460,6 @@ class TExecutor
bool HadFollowerAttached = false;
bool NeedFollowerSnapshot = false;
- TCacheCacheConfig::TCounterPtr CounterCacheFresh;
- TCacheCacheConfig::TCounterPtr CounterCacheWarm;
- TCacheCacheConfig::TCounterPtr CounterCacheStaging;
-
THashMap<ui32, TIntrusivePtr<TBarrier>> InFlyCompactionGcBarriers;
TDeque<THolder<TEvTablet::TFUpdateBody>> PostponedFollowerUpdates;
THashMap<ui32, TVector<TIntrusivePtr<TBarrier>>> InFlySnapCollectionBarriers;
diff --git a/ydb/core/tablet_flat/flat_sausagecache.cpp b/ydb/core/tablet_flat/flat_sausagecache.cpp
index 9a9c834517..fc3a6cbdc3 100644
--- a/ydb/core/tablet_flat/flat_sausagecache.cpp
+++ b/ydb/core/tablet_flat/flat_sausagecache.cpp
@@ -40,12 +40,6 @@ TPrivatePageCache::TInfo::TInfo(const TInfo &info)
}
}
-TPrivatePageCache::TPrivatePageCache(const TCacheCacheConfig &cacheConfig)
-{
- // todo: clean up
- (void)cacheConfig;
-}
-
void TPrivatePageCache::RegisterPageCollection(TIntrusivePtr<TInfo> info) {
auto itpair = PageCollections.insert(decltype(PageCollections)::value_type(info->Id, info));
Y_VERIFY(itpair.second, "double registration of page collection is forbidden. logic flaw?");
@@ -512,11 +506,6 @@ void TPrivatePageCache::DropSharedBody(TInfo *info, ui32 pageId) {
}
}
-void TPrivatePageCache::UpdateCacheSize(ui64 cacheSize) {
- // todo: clean up
- (void)cacheSize;
-}
-
TPrivatePageCache::TPage::TWaitQueuePtr TPrivatePageCache::ProvideBlock(
NSharedCache::TEvResult::TLoaded&& loaded, TInfo *info)
{
diff --git a/ydb/core/tablet_flat/flat_sausagecache.h b/ydb/core/tablet_flat/flat_sausagecache.h
index f09852ca02..3a1b830e2e 100644
--- a/ydb/core/tablet_flat/flat_sausagecache.h
+++ b/ydb/core/tablet_flat/flat_sausagecache.h
@@ -136,8 +136,6 @@ public:
};
public:
- TPrivatePageCache(const TCacheCacheConfig &cacheConfig);
-
void RegisterPageCollection(TIntrusivePtr<TInfo> info);
TPage::TWaitQueuePtr ForgetPageCollection(TLogoBlobID id);
@@ -166,7 +164,6 @@ public:
void UpdateSharedBody(TInfo *collectionInfo, ui32 pageId, TSharedPageRef shared);
void DropSharedBody(TInfo *collectionInfo, ui32 pageId);
- void UpdateCacheSize(ui64 cacheSize);
TPage::TWaitQueuePtr ProvideBlock(NSharedCache::TEvResult::TLoaded&& loaded, TInfo *collectionInfo);
THashMap<TLogoBlobID, TIntrusivePtr<TInfo>> DetachPrivatePageCache();
THashMap<TLogoBlobID, THashMap<ui32, TSharedData>> GetPrepareSharedTouched();