Skip to content
Merged
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
19 changes: 11 additions & 8 deletions ydb/core/tx/columnshard/engines/ut/ut_logs_engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,9 @@ TBlobRange MakeBlobRange(ui32 step, ui32 blobSize) {
return TBlobRange(MakeUnifiedBlobId(step, blobSize), 0, blobSize);
}

TString MakeTestBlob(i64 start = 0, i64 end = 100) {
TString MakeTestBlob(i64 start = 0, i64 end = 100, ui32 step = 1) {
TBuilder<arrow::TimestampType> builder;
for (i64 ts = start; ts < end; ++ts) {
for (i64 ts = start; ts < end; ts += step) {
TString str = ToString(ts);
TString sortedStr = Sprintf("%05ld", (long)ts);
builder.AddRow({ts, sortedStr, str, str, str});
Expand Down Expand Up @@ -701,10 +701,11 @@ Y_UNIT_TEST_SUITE(TColumnEngineTestLogs) {
engine.RegisterTable(pathId);
engine.Load(db);

ui64 numRows = 1000;
ui64 rowPos = 0;
for (ui64 txId = 1; txId <= 20; ++txId, rowPos += numRows) {
TString testBlob = MakeTestBlob(rowPos, rowPos + numRows);
const ui64 numRows = 1000;
const ui64 txCount = 20;
const ui32 tsIncrement = 1;
for (ui64 txId = 1; txId <= txCount; ++txId) {
TString testBlob = MakeTestBlob((txId - 1) * numRows * tsIncrement, txId * numRows * tsIncrement, tsIncrement);
auto blobRange = MakeBlobRange(++step, testBlob.size());
NBlobOperations::NRead::TCompositeReadBlobs blobs;
TString str1 = testBlob;
Expand Down Expand Up @@ -750,9 +751,11 @@ Y_UNIT_TEST_SUITE(TColumnEngineTestLogs) {
std::shared_ptr<arrow::DataType> ttlColType = arrow::timestamp(arrow::TimeUnit::MICRO);
THashMap<ui64, NOlap::TTiering> pathTtls;
NOlap::TTiering tiering;
AFL_VERIFY(tiering.Add(NOlap::TTierInfo::MakeTtl(TDuration::MicroSeconds(TInstant::Now().MicroSeconds() - 10000), "timestamp")));
AFL_VERIFY(tiering.Add(NOlap::TTierInfo::MakeTtl(TDuration::MicroSeconds(TInstant::Now().MicroSeconds() - txCount / 2 * numRows * tsIncrement), "timestamp")));
pathTtls.emplace(pathId, std::move(tiering));
Ttl(engine, db, pathTtls, 10);
//if this check flaps consider to slightly increase tsIncrement value above
//it it fails regularly it' a problem to investigate
Ttl(engine, db, pathTtls, txCount / 2 );

// read + load + read

Expand Down