Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions ydb/core/protos/config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1573,6 +1573,15 @@ message TImmediateControlsConfig {
DefaultValue: 0 }];
}

message TTestShardControls {
optional uint64 DisableWrites = 1 [(ControlOptions) = {
Description: "Disable write load in all node TestShard tablets",
MinValue: 0,
MaxValue: 1,
DefaultValue: 0
}];
}

optional TDataShardControls DataShardControls = 1;
optional TTxLimitControls TxLimitControls = 2;
optional TCoordinatorControls CoordinatorControls = 3;
Expand All @@ -1585,6 +1594,7 @@ message TImmediateControlsConfig {
optional TPDiskControls PDiskControls = 10;
optional TBlobStorageControllerControls BlobStorageControllerControls = 11;
optional TTableServiceControls TableServiceControls = 12;
optional TTestShardControls TestShardControls = 13;
};

message TMeteringConfig {
Expand Down
11 changes: 10 additions & 1 deletion ydb/core/test_tablet/load_actor_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ namespace NKikimr::NTestShard {
} else {
sys->Send(ev.release());
}

auto *appData = AppData();
appData->Icb->RegisterSharedControl(DisableWrites, "TestShardControls.DisableWrites");
}

void TLoadActor::ClearKeys() {
Expand Down Expand Up @@ -89,7 +92,7 @@ namespace NKikimr::NTestShard {
const TMonotonic now = TActivationContext::Monotonic();

bool canWriteMore = false;
if (WritesInFlight.size() + PatchesInFlight.size() < Settings.GetMaxInFlight()) {
if (WritesInFlight.size() + PatchesInFlight.size() < Settings.GetMaxInFlight() && !DisableWrites) {
if (NextWriteTimestamp <= now) {
if (Settings.HasPatchRequestsFractionPPM() && !ConfirmedKeys.empty() &&
RandomNumber(1'000'000u) < Settings.GetPatchRequestsFractionPPM()) {
Expand Down Expand Up @@ -123,6 +126,12 @@ namespace NKikimr::NTestShard {
TActivationContext::Send(new IEventHandle(EvDoSomeAction, 0, SelfId(), {}, nullptr, 0));
DoSomeActionInFlight = true;
}

if (!DoSomeActionInFlight && ReadsInFlight.empty() && WritesInFlight.empty() && PatchesInFlight.empty() &&
DeletesInFlight.empty() && TransitionInFlight.empty()) {
TActivationContext::Schedule(TDuration::Seconds(1), new IEventHandle(EvDoSomeAction, 0, SelfId(), {}, nullptr, 0));
DoSomeActionInFlight = true;
}
}
}

Expand Down
2 changes: 2 additions & 0 deletions ydb/core/test_tablet/load_actor_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ namespace NKikimr::NTestShard {
bool WriteOnTimeScheduled = false;
bool DoSomeActionInFlight = false;

TControlWrapper DisableWrites;

void GenerateKeyValue(TString *key, TString *value, bool *isInline);
void IssueWrite();
void IssuePatch();
Expand Down
Loading