Skip to content

Conversation

LebedevOleg1
Copy link
Collaborator

Changelog entry

[full-backup] Smoke test for full restore with simple schema change
...

Changelog category

  • Not for changelog (changelog entry is not required)

Description for reviewers

[full-backup] Smoke test for full restore with simple schema change
...

Copy link

github-actions bot commented Oct 14, 2025

🟢 2025-10-16 17:48:29 UTC The validation of the Pull Request description is successful.

This comment was marked as outdated.

This comment was marked as outdated.

@LebedevOleg1 LebedevOleg1 changed the title Test3 [full-backup] Smoke test for full restore with simple schema change Oct 14, 2025
@Enjection Enjection changed the title [full-backup] Smoke test for full restore with simple schema change [incr-backup] Smoke test for full restore with simple schema change Oct 14, 2025
@Enjection
Copy link
Member

Renamed to [incr-backup] as it is like tag for a feature in general, even if this particular test covers only full-backup functionality inside this bigger feature

Comment on lines 966 to 981
def _create_backup_collection(self, collection_src, tables: List[str]):
# create backup collection referencing given table full paths
table_entries = ",\n".join([f"TABLE `/Root/{t}`" for t in tables])
sql = f"""
CREATE BACKUP COLLECTION `{collection_src}`
( {table_entries} )
WITH ( STORAGE = 'cluster', INCREMENTAL_BACKUP_ENABLED = 'false' );
"""
res = self._execute_yql(sql)
stderr_out = ""
if getattr(res, 'std_err', None):
stderr_out += res.std_err.decode('utf-8', errors='ignore')
if getattr(res, 'std_out', None):
stderr_out += res.std_out.decode('utf-8', errors='ignore')
assert res.exit_code == 0, f"CREATE BACKUP COLLECTION failed: {stderr_out}"
self.wait_for_collection(collection_src, timeout_s=30)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is better to extract this to common base class to avoid repetition

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(same applies to other "common" reusable methods as well)

res = self._execute_yql(cmd)
assert res.exit_code == 0, "Failed to apply GRANT in wave 2"

# capture state after wave 2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this purpose usually word "stage" used

Comment on lines 1209 to 1212
try:
session.execute_scheme('DROP TABLE `/Root/extra_table_1`;')
except Exception:
pass
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should explicitly state expected behavior. For now we expect it to fail (even though it is not failing actually). So write test that actually fails on it and mark it as muted like it is done here https://github.com/ydb-platform/ydb/pull/26845/files) and create issue (e.g. Incremental backup must forbid removal of managed objects)

@LebedevOleg1 LebedevOleg1 self-assigned this Oct 14, 2025

This comment was marked as outdated.

This comment was marked as outdated.

# remove some tables from step5: drop extra_table_1
try:
session.execute_scheme('DROP TABLE `/Root/extra_table_1`;')
except Exception:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MUST fail for t1 and t2 until they are under backup collection. We must allow dropping tables only when backup collection referencing this tables dropped. (Or maybe we need to reconsider this semantics)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, make assert here and create issue, please

This comment was marked as outdated.

This comment was marked as outdated.

Copy link

github-actions bot commented Oct 16, 2025

2025-10-16 10:55:23 UTC Pre-commit check linux-x86_64-relwithdebinfo for 5dcffad has started.
2025-10-16 10:55:27 UTC Artifacts will be uploaded here
2025-10-16 10:58:04 UTC ya make is running...
🟢 2025-10-16 11:00:42 UTC Tests successful.

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
15 15 0 0 0 0

🟢 2025-10-16 11:00:44 UTC Build successful.
🟢 2025-10-16 11:00:55 UTC ydbd size 2.3 GiB changed* by +16.0 KiB, which is < 100.0 KiB vs main: OK

ydbd size dash main: be8030f merge: 5dcffad diff diff %
ydbd size 2 424 167 608 Bytes 2 424 183 960 Bytes +16.0 KiB +0.001%
ydbd stripped size 516 061 640 Bytes 516 068 808 Bytes +7.0 KiB +0.001%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

Copy link

github-actions bot commented Oct 16, 2025

2025-10-16 10:56:17 UTC Pre-commit check linux-x86_64-release-asan for 5dcffad has started.
2025-10-16 10:57:11 UTC Artifacts will be uploaded here
2025-10-16 11:00:47 UTC ya make is running...
🟢 2025-10-16 11:02:11 UTC Tests successful.

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
3 3 0 0 0 0

🟢 2025-10-16 11:02:13 UTC Build successful.
🟢 2025-10-16 11:02:27 UTC ydbd size 3.8 GiB changed* by +32.5 KiB, which is < 100.0 KiB vs main: OK

ydbd size dash main: be8030f merge: 5dcffad diff diff %
ydbd size 4 033 257 632 Bytes 4 033 290 888 Bytes +32.5 KiB +0.001%
ydbd stripped size 1 497 996 768 Bytes 1 498 016 416 Bytes +19.2 KiB +0.001%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@Enjection Enjection merged commit 0cf099b into ydb-platform:main Oct 16, 2025
12 checks passed
@CyberROFL CyberROFL linked an issue Oct 16, 2025 that may be closed by this pull request
@CyberROFL CyberROFL changed the title [incr-backup] Smoke test for full restore with simple schema change Smoke test for full restore with simple schema change Oct 16, 2025
@CyberROFL CyberROFL changed the title Smoke test for full restore with simple schema change Full restore test with simple schema change Oct 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

👑 Local Incremental Backups: Integration Testing

2 participants