Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanmorozov333 committed Oct 5, 2024
1 parent d617844 commit 256fd10
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
7 changes: 4 additions & 3 deletions ydb/core/tx/columnshard/engines/portions/portion_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,10 @@ class TPortionInfo {
private:
friend class TPortionInfoConstructor;
TPortionInfo(TPortionMeta&& meta)
: Meta(std::move(meta))
{

: Meta(std::move(meta)) {
if (Meta.GetProduced() == NPortion::EProduced::INSERTED) {
AFL_VERIFY(!Meta.GetTierName());
}
}
std::optional<TSnapshot> CommitSnapshot;
std::optional<TInsertWriteId> InsertWriteId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ void TTieringActualizer::DoExtractTasks(TTieringProcessContext& tasksContext, co
for (auto&& p : portions) {
auto portion = externalContext.GetPortionVerified(p);
if (!address.WriteIs(NBlobOperations::TGlobal::DefaultStorageId) && !address.WriteIs(NTiering::NCommon::DeleteTierName)) {
if (!portion->HasRuntimeFeature(TPortionInfo::ERuntimeFeature::Optimized)) {
if (!portion->HasRuntimeFeature(TPortionInfo::ERuntimeFeature::Optimized) || portion->HasInsertWriteId()) {
Counters.SkipEvictionForCompaction->Add(1);
continue;
}
Expand Down
8 changes: 5 additions & 3 deletions ydb/core/tx/tiering/ut/ut_tiers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -606,9 +606,10 @@ Y_UNIT_TEST_SUITE(ColumnShardTiers) {
runtime.UpdateCurrentTime(now);
const TInstant pkStart = now - TDuration::Days(15);

auto batch = lHelper.TestArrowBatch(0, pkStart.GetValue(), 6000);
auto batch1 = lHelper.TestArrowBatch(0, pkStart.GetValue(), 6000);
auto batch2 = lHelper.TestArrowBatch(0, pkStart.GetValue() - 100, 6000);
auto batchSmall = lHelper.TestArrowBatch(0, now.GetValue(), 1);
auto batchSize = NArrow::GetBatchDataSize(batch);
auto batchSize = NArrow::GetBatchDataSize(batch1);
Cerr << "Inserting " << batchSize << " bytes..." << Endl;
UNIT_ASSERT(batchSize > 4 * 1024 * 1024); // NColumnShard::TLimits::MIN_BYTES_TO_INSERT
UNIT_ASSERT(batchSize < 8 * 1024 * 1024);
Expand All @@ -617,7 +618,8 @@ Y_UNIT_TEST_SUITE(ColumnShardTiers) {
TAtomic unusedPrev;
runtime.GetAppData().Icb->SetValue("ColumnShardControls.GranuleIndexedPortionsCountLimit", 1, unusedPrev);
}
lHelper.SendDataViaActorSystem("/Root/olapStore/olapTable", batch);
lHelper.SendDataViaActorSystem("/Root/olapStore/olapTable", batch1);
lHelper.SendDataViaActorSystem("/Root/olapStore/olapTable", batch2);
{
const TInstant start = Now();
bool check = false;
Expand Down

0 comments on commit 256fd10

Please sign in to comment.