Skip to content

Commit b139feb

Browse files
xyliganSerejaMatveev Sergei
and
Matveev Sergei
authored
Unmute ttl_delete test and fix bad in sys_view. Ydb issue 16597 (#18094)
Co-authored-by: Matveev Sergei <[email protected]>
1 parent e0b7354 commit b139feb

File tree

4 files changed

+9
-19
lines changed

4 files changed

+9
-19
lines changed

ydb/tests/olap/common/column_table_helper.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,8 @@ def get_volumes_column(self, column_name: str) -> tuple[int, int]:
7474
raw_bytes, bytes = self._coollect_volumes_column(column_name)
7575
logging.info(f"Table `{self.path}`, volumes `{column_name}` ({raw_bytes}, {bytes})")
7676
return raw_bytes, bytes
77+
78+
def portions_actualized_in_sys(self):
79+
portions = self.get_portion_stat_by_tier()
80+
logger.info(f"portions: {portions}, blobs: {self.get_blob_stat_by_tier()}")
81+
return "__DEFAULT" in portions

ydb/tests/olap/ttl_tiering/base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def _setup_ydb(cls):
4040
config = KikimrConfigGenerator(
4141
extra_feature_flags={
4242
"enable_external_data_sources": True,
43+
"enable_write_portions_on_insert": True,
4344
"enable_tiering_in_column_shard": True
4445
},
4546
column_shard_config={

ydb/tests/olap/ttl_tiering/data_migration_when_alter_ttl.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -133,15 +133,7 @@ def test(self):
133133
if not self.wait_for(lambda: len(table.get_portion_stat_by_tier()) != 0, plain_or_under_sanitizer(60, 120)):
134134
raise Exception("portion count equal zero after insert data")
135135

136-
def portions_actualized_in_sys():
137-
portions = table.get_portion_stat_by_tier()
138-
logger.info(f"portions: {portions}, blobs: {table.get_blob_stat_by_tier()}")
139-
if len(portions) != 1 or "__DEFAULT" not in portions:
140-
raise Exception("Data not in __DEFAULT teir")
141-
return self.row_count <= portions["__DEFAULT"]["Rows"]
142-
143-
if not self.wait_for(lambda: portions_actualized_in_sys(), plain_or_under_sanitizer(120, 240)):
144-
raise Exception(".sys reports incorrect data portions")
136+
assert ColumnTableHelper.portions_actualized_in_sys(table)
145137

146138
# Step 4
147139
t0 = time.time()

ydb/tests/olap/ttl_tiering/ttl_delete_s3.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@ class TllDeleteBase(TllTieringTestBase):
1414
days_to_cool = 1000
1515
days_to_freeze = 3000
1616

17-
@classmethod
18-
def portions_actualized_in_sys(self, table):
19-
portions = table.get_portion_stat_by_tier()
20-
logger.info(f"portions: {portions}, blobs: {table.get_blob_stat_by_tier()}")
21-
return "__DEFAULT" in portions and self.row_count > portions["__DEFAULT"]["Rows"]
22-
2317
@classmethod
2418
def get_row_count_by_date(self, table_path: str, past_days: int) -> int:
2519
return self.ydb_client.query(f"SELECT count(*) as Rows from `{table_path}` WHERE ts < CurrentUtcTimestamp() - DateTime::IntervalFromDays({past_days})")[0].rows[0]["Rows"]
@@ -273,8 +267,7 @@ def test_delete_s3_tiering(self):
273267
logger.info(f"Rows older than {self.days_to_cool} days: {self.get_row_count_by_date(table_path, self.days_to_cool)}")
274268
logger.info(f"Rows older than {self.days_to_freeze} days: {self.get_row_count_by_date(table_path, self.days_to_freeze)}")
275269

276-
if not self.wait_for(lambda: self.portions_actualized_in_sys(self.table), 120):
277-
raise Exception(".sys reports incorrect data portions")
270+
assert ColumnTableHelper.portions_actualized_in_sys(self.table)
278271

279272
stmt = f"""
280273
DELETE FROM `{table_path}`
@@ -382,8 +375,7 @@ def test_ttl_delete(self):
382375
logger.info(f"Rows older than {self.days_to_cool} days: {self.get_row_count_by_date(table_path, self.days_to_cool)}")
383376
logger.info(f"Rows older than {self.days_to_freeze} days: {self.get_row_count_by_date(table_path, self.days_to_freeze)}")
384377

385-
if not self.wait_for(lambda: self.portions_actualized_in_sys(self.table), 200):
386-
raise Exception(".sys reports incorrect data portions")
378+
assert ColumnTableHelper.portions_actualized_in_sys(self.table)
387379

388380
t0 = time.time()
389381
stmt = f"""

0 commit comments

Comments
 (0)