Skip to content

Commit a2e5443

Browse files
authored
Remove KIKIMR_ALLOW_FLOWCONTROLLED_QUEUE_FOR_SSLOOKUP (#6511)
1 parent 090a8c8 commit a2e5443

File tree

5 files changed

+7
-317
lines changed

5 files changed

+7
-317
lines changed

ydb/core/base/compile_time_flags.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@
88
#define KIKIMR_VDISK_SYNCLOG_ENTRY_POINT_PROTO_FORMAT 0
99
#endif
1010

11-
// This feature flag enables use of flow controlled queue in statestorage lookup requests
12-
#ifndef KIKIMR_ALLOW_FLOWCONTROLLED_QUEUE_FOR_SSLOOKUP
13-
#define KIKIMR_ALLOW_FLOWCONTROLLED_QUEUE_FOR_SSLOOKUP 0
14-
#endif
15-
1611
// This feature flag enables statestorage replica probes
1712
#ifndef KIKIMR_ALLOW_SSREPLICA_PROBES
1813
#define KIKIMR_ALLOW_SSREPLICA_PROBES 0

ydb/core/base/statestorage_proxy.cpp

Lines changed: 7 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include <ydb/library/actors/core/hfunc.h>
99
#include <ydb/library/actors/core/interconnect.h>
1010
#include <ydb/library/actors/core/log.h>
11-
#include <ydb/library/actors/helpers/flow_controlled_queue.h>
1211

1312
#include <util/digest/city.h>
1413
#include <util/generic/xrange.h>
@@ -235,15 +234,11 @@ class TStateStorageProxyRequest : public TActor<TStateStorageProxyRequest> {
235234
}
236235

237236
template<typename TEv>
238-
void PrepareInit(TEv *ev, bool allowFlowControlled) {
237+
void PrepareInit(TEv *ev) {
239238
TabletID = ev->TabletID;
240239
Cookie = ev->Cookie;
241240
ProxyOptions = ev->ProxyOptions;
242-
243-
if (allowFlowControlled && FlowControlledInfo.Get() && KIKIMR_ALLOW_FLOWCONTROLLED_QUEUE_FOR_SSLOOKUP)
244-
SelectRequestReplicas(FlowControlledInfo.Get());
245-
else
246-
SelectRequestReplicas(Info.Get());
241+
SelectRequestReplicas(Info.Get());
247242
}
248243

249244
// request setup
@@ -253,7 +248,7 @@ class TStateStorageProxyRequest : public TActor<TStateStorageProxyRequest> {
253248
BLOG_D("ProxyRequest::HandleInit ev: " << msg->ToString());
254249
Source = ev->Sender;
255250

256-
PrepareInit(msg, true);
251+
PrepareInit(msg);
257252
SendRequest([this](ui64 cookie) { return new TEvStateStorage::TEvReplicaLookup(TabletID, cookie); });
258253

259254
Become(&TThis::StateLookup, TDuration::MicroSeconds(StateStorageRequestTimeout), new TEvents::TEvWakeup());
@@ -264,7 +259,7 @@ class TStateStorageProxyRequest : public TActor<TStateStorageProxyRequest> {
264259
BLOG_D("ProxyRequest::HandleInit ev: %s" << msg->ToString());
265260
Source = ev->Sender;
266261

267-
PrepareInit(msg, false);
262+
PrepareInit(msg);
268263

269264
SuggestedLeader = msg->ProposedLeader;
270265
SuggestedLeaderTablet = msg->ProposedLeaderTablet;
@@ -286,7 +281,7 @@ class TStateStorageProxyRequest : public TActor<TStateStorageProxyRequest> {
286281
BLOG_D("ProxyRequest::HandleInit ev: " << msg->ToString());
287282
Source = ev->Sender;
288283

289-
PrepareInit(msg, false);
284+
PrepareInit(msg);
290285

291286
SuggestedLeader = msg->ProposedLeader;
292287
SuggestedGeneration = msg->ProposedGeneration;
@@ -866,13 +861,11 @@ class TStateStorageProxy : public TActor<TStateStorageProxy> {
866861

867862
void Handle(TEvStateStorage::TEvUpdateGroupConfig::TPtr &ev) {
868863
auto *msg = ev->Get();
869-
TIntrusivePtr<TStateStorageInfo> old = Info;
870-
871864
Info = msg->GroupConfig;
872865
BoardInfo = msg->BoardConfig;
873866
SchemeBoardInfo = msg->SchemeBoardConfig;
874867

875-
RegisterDerivedServices(TlsActivationContext->ExecutorThread.ActorSystem, old.Get());
868+
RegisterReplicaProbes(TlsActivationContext->ExecutorThread.ActorSystem);
876869

877870
for (const auto& [key, value] : Subscriptions) {
878871
const auto& [sender, cookie] = key;
@@ -885,11 +878,6 @@ class TStateStorageProxy : public TActor<TStateStorageProxy> {
885878
}
886879
}
887880

888-
void RegisterDerivedServices(TActorSystem *sys, const TStateStorageInfo *old) {
889-
RegisterReplicaProbes(sys);
890-
RegisterFlowContolled(sys, old);
891-
}
892-
893881
void RegisterReplicaProbes(TActorSystem *sys) {
894882
if (!KIKIMR_ALLOW_SSREPLICA_PROBES)
895883
return;
@@ -916,65 +904,8 @@ class TStateStorageProxy : public TActor<TStateStorageProxy> {
916904
Send(ev->Sender, reply.Release(), 0, ev->Cookie);
917905
}
918906

919-
void RegisterFlowContolled(TActorSystem *sys, const TStateStorageInfo *old) {
920-
if (!KIKIMR_ALLOW_FLOWCONTROLLED_QUEUE_FOR_SSLOOKUP)
921-
return;
922-
923-
TIntrusivePtr<TStateStorageInfo> updated = new TStateStorageInfo();
924-
updated->NToSelect = Info->NToSelect;
925-
updated->Rings.resize(Info->Rings.size());
926-
927-
const bool checkOldInfo = FlowControlledInfo && old
928-
&& updated->NToSelect == FlowControlledInfo->NToSelect
929-
&& updated->Rings.size() == FlowControlledInfo->Rings.size();
930-
931-
ui32 ringIdx = 0;
932-
for (const ui32 ringsSz = Info->Rings.size(); ringIdx < ringsSz; ++ringIdx) {
933-
const bool checkRing = checkOldInfo && (FlowControlledInfo->Rings[ringIdx].Replicas.size() == Info->Rings[ringIdx].Replicas.size());
934-
935-
TStateStorageInfo::TRing &ctring = updated->Rings[ringIdx];
936-
TStateStorageInfo::TRing *fcring = checkRing ? &FlowControlledInfo->Rings[ringIdx] : nullptr;
937-
const auto &srcring = Info->Rings[ringIdx];
938-
const auto *oldring = checkRing ? &old->Rings[ringIdx] : nullptr;
939-
940-
ctring.Replicas.resize(srcring.Replicas.size());
941-
ui32 replicaIdx = 0;
942-
for (const ui32 srcSize = srcring.Replicas.size(); replicaIdx < srcSize; ++replicaIdx) {
943-
if (checkRing && srcring.Replicas[replicaIdx] == oldring->Replicas[replicaIdx]) {
944-
ctring.Replicas[replicaIdx] = fcring->Replicas[replicaIdx];
945-
fcring->Replicas[replicaIdx] = TActorId();
946-
} else {
947-
if (fcring && replicaIdx < fcring->Replicas.size())
948-
Send(fcring->Replicas[replicaIdx], new TEvents::TEvPoison());
949-
950-
TFlowControlledQueueConfig flowConfig;
951-
flowConfig.MaxAllowedInFly = 10000;
952-
flowConfig.TargetDynamicRate = 250000;
953-
954-
ctring.Replicas[replicaIdx] = sys->Register(
955-
CreateFlowControlledRequestQueue(srcring.Replicas[replicaIdx], NKikimrServices::TActivity::SS_PROXY_REQUEST, flowConfig),
956-
TMailboxType::ReadAsFilled
957-
);
958-
}
959-
}
960-
if (fcring) {
961-
for (const ui32 fcSize = fcring->Replicas.size(); replicaIdx < fcSize; ++replicaIdx) {
962-
Send(fcring->Replicas[replicaIdx], new TEvents::TEvPoison());
963-
}
964-
}
965-
}
966-
if (FlowControlledInfo) {
967-
for (const ui32 oldSize = FlowControlledInfo->Rings.size(); ringIdx < oldSize; ++ringIdx) {
968-
for (TActorId outdated : FlowControlledInfo->Rings[oldSize].Replicas)
969-
Send(outdated, new TEvents::TEvPoison());
970-
}
971-
}
972-
973-
FlowControlledInfo = std::move(updated);
974-
}
975-
976907
void Registered(TActorSystem* sys, const TActorId&) {
977-
RegisterDerivedServices(sys, nullptr);
908+
RegisterReplicaProbes(sys);
978909
}
979910
public:
980911
static constexpr NKikimrServices::TActivity::EType ActorActivityType() {

ydb/library/actors/helpers/flow_controlled_queue.cpp

Lines changed: 0 additions & 215 deletions
This file was deleted.

ydb/library/actors/helpers/flow_controlled_queue.h

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)