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
2 changes: 2 additions & 0 deletions ydb/core/protos/config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1514,6 +1514,8 @@ message TColumnShardConfig {
optional string Description = 2;
}
repeated TRepairInfo Repairs = 15;

optional uint32 MaxInFlightIntervalsOnRequest = 16;
}

message TSchemeShardConfig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ void TScanHead::OnIntervalResult(const std::optional<NArrow::TShardedRecordBatch
std::unique_ptr<NArrow::NMerger::TMergePartialStream>&& merger, const ui32 intervalIdx, TPlainReadData& reader) {
if (Context->GetReadMetadata()->Limit && (!newBatch || newBatch->GetRecordsCount() == 0) && InFlightLimit < 1000) {
if (++ZeroCount == std::max<ui64>(16, InFlightLimit)) {
InFlightLimit *= 2;
InFlightLimit = std::max<ui32>(MaxInFlight, InFlightLimit * 2);
ZeroCount = 0;
}
} else {
Expand Down Expand Up @@ -97,7 +97,17 @@ TConclusionStatus TScanHead::Start() {
TScanHead::TScanHead(std::deque<std::shared_ptr<IDataSource>>&& sources, const std::shared_ptr<TSpecialReadContext>& context)
: Context(context)
{
InFlightLimit = Context->GetReadMetadata()->Limit ? 1 : Max<ui32>();
if (!HasAppData() || !AppDataVerified().ColumnShardConfig.HasMaxInFlightIntervalsOnRequest()) {
MaxInFlight = 256;
} else {
MaxInFlight = AppDataVerified().ColumnShardConfig.GetMaxInFlightIntervalsOnRequest();
}

if (Context->GetReadMetadata()->Limit) {
InFlightLimit = 1;
} else {
InFlightLimit = MaxInFlight;
}
while (sources.size()) {
auto source = sources.front();
BorderPoints[source->GetStart()].AddStart(source);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ class TScanHead {
ui32 SegmentIdxCounter = 0;
std::vector<TIntervalStat> IntervalStats;
ui64 InFlightLimit = 1;
ui64 MaxInFlight = 256;
ui64 ZeroCount = 0;
bool AbortFlag = false;
void DrainSources();
Expand Down