aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreivanov89 <eivanov89@ydb.tech>2022-09-28 14:39:20 +0300
committereivanov89 <eivanov89@ydb.tech>2022-09-28 14:39:20 +0300
commitb5cfe4dadd6e1f96663da5b2df0ec6a7d99990f0 (patch)
tree877c0116de8eab9a32be7c8b8765a22b4a39f349
parente49a6d731192528f21228bf8bbbdeb78b35a5dca (diff)
downloadydb-b5cfe4dadd6e1f96663da5b2df0ec6a7d99990f0.tar.gz
PR from branch users/eivanov89/-iterator-load-actor
more load inflight for read iter add readcount load option
-rw-r--r--ydb/core/protos/datashard_load.proto10
-rw-r--r--ydb/core/tx/datashard/testload/test_load_read_iterator.cpp25
2 files changed, 29 insertions, 6 deletions
diff --git a/ydb/core/protos/datashard_load.proto b/ydb/core/protos/datashard_load.proto
index 728e3320739..d092e530fab 100644
--- a/ydb/core/protos/datashard_load.proto
+++ b/ydb/core/protos/datashard_load.proto
@@ -25,13 +25,17 @@ message TEvTestLoadRequest {
optional string Path = 1;
// defines dataset size, normally must be withing 2 GiB
+ // also used for full scan
optional uint64 RowCount = 2;
- repeated uint32 Inflights = 3;
- repeated uint32 Chunks = 4;
+ // number of random rows to be read (point reads)
+ optional uint64 ReadCount = 3;
+
+ repeated uint32 Inflights = 4;
+ repeated uint32 Chunks = 5;
// Specifies the format for result data in TEvReadResult
- optional NKikimrTxDataShard.EScanDataFormat ResultFormat = 5;
+ optional NKikimrTxDataShard.EScanDataFormat ResultFormat = 6;
}
optional uint64 Cookie = 1;
diff --git a/ydb/core/tx/datashard/testload/test_load_read_iterator.cpp b/ydb/core/tx/datashard/testload/test_load_read_iterator.cpp
index 6c3540259cf..8d771f3587d 100644
--- a/ydb/core/tx/datashard/testload/test_load_read_iterator.cpp
+++ b/ydb/core/tx/datashard/testload/test_load_read_iterator.cpp
@@ -100,6 +100,7 @@ class TReadIteratorPoints : public TActorBootstrapped<TReadIteratorPoints> {
size_t Oks = 0;
TVector<TOwnedCellVec> Points;
+ ui64 ReadCount = 0;
size_t CurrentPoint = 0;
THPTimer RequestTimer;
@@ -109,12 +110,14 @@ public:
TReadIteratorPoints(TEvDataShard::TEvRead* request,
ui64 tablet,
const TActorId& parent,
- const TVector<TOwnedCellVec>& points)
+ const TVector<TOwnedCellVec>& points,
+ ui64 readCount)
: BaseRequest(request)
, Format(BaseRequest->Record.GetResultFormat())
, TabletId(tablet)
, Parent(parent)
, Points(points)
+ , ReadCount(readCount)
{
RequestTimes.reserve(Points.size());
}
@@ -128,6 +131,8 @@ public:
auto rng = std::default_random_engine {};
std::shuffle(Points.begin(), Points.end(), rng);
+ Points.resize(ReadCount);
+
Connect(ctx);
}
@@ -435,9 +440,11 @@ class TReadIteratorLoadScenario : public TActorBootstrapped<TReadIteratorLoadSce
size_t ChunkIndex = 0;
// note that might be overwritten by test incoming test config
- TVector<ui64> Inflights = {1, 2, 10, 50, 100, 200, 400};
+ TVector<ui64> Inflights = {1, 2, 10, 50, 100, 200, 400, 1000, 2000, 5000};
size_t InflightIndex = 0;
+ ui64 ReadCount = 0;
+
public:
TReadIteratorLoadScenario(const NKikimrDataShardLoad::TEvTestLoadRequest::TReadStart& cmd, const TActorId& parent,
TIntrusivePtr<::NMonitoring::TDynamicCounters> counters, ui64 tag)
@@ -462,6 +469,12 @@ public:
ChunkSizes.push_back(chunk);
}
}
+
+ if (Config.HasReadCount()) {
+ ReadCount = Config.GetReadCount();
+ } else {
+ ReadCount = Config.GetRowCount();
+ }
}
void Bootstrap(const TActorContext& ctx) {
@@ -686,7 +699,13 @@ private:
record.SetResultFormat(::NKikimrTxDataShard::EScanDataFormat::CELLVEC);
- auto* readActor = new TReadIteratorPoints(request.release(), TabletId, SelfId(), Keys);
+ auto* readActor = new TReadIteratorPoints(
+ request.release(),
+ TabletId,
+ SelfId(),
+ Keys,
+ ReadCount);
+
StartedActors.emplace_back(ctx.Register(readActor));
LOG_DEBUG_S(ctx, NKikimrServices::DS_LOAD_TEST, "ReadIteratorLoadScenario# " << Tag