Skip to content

Conversation

@jepett0
Copy link
Contributor

@jepett0 jepett0 commented Jan 14, 2025

Enable views in imports

View imports go through these steps:

  • GetScheme, download the scheme from S3 (this stage is the same for views and tables)
  • modify the query a bit (search for the RewriteCreateViewQuery function call in the OnSchemeResult function)
  • CreateTable, (should have been named CreateView, but we don't want to create a separate step in the import pipeline just for the sake of a better naming), prepares the create view query that was downloaded and patched in the previous steps
  • set the PreparedCreationQuery of the view item (note: this field is persisted)
  • ExecutePreparedQuery, see the corresponding function here. It is important to notice that we add permissions that were stored in the S3 to the modify scheme event at this step.
  • OnModifyResult, same as for the tables
  • OnNotifyResult, same as for the tables (view items go straight to the Done state from here)

In terms of the import EStates the view item progression is the following:

  • GetScheme
  • CreateTable
    • PreparedCreationQuery is not set
    • PreparedCreationQuery is set
  • Done

View creation is retried in case of scheme errors (scheme error is the error code that is returned in the case (among others) when the view references a table that does not exist). There is only 1 retry per view.

The main commit is:

A couple of bug fixes along the way (please verify, if you know the code):

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@jepett0 jepett0 requested a review from CyberROFL January 14, 2025 14:43
@jepett0 jepett0 marked this pull request as ready for review January 14, 2025 14:43
@jepett0 jepett0 requested a review from a team as a code owner January 14, 2025 14:43
@jepett0 jepett0 changed the title VIEW: import VIEW: export and import of views Jan 14, 2025
@jepett0 jepett0 marked this pull request as draft January 14, 2025 15:58
@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@jepett0 jepett0 changed the title VIEW: export and import of views VIEW: import Jan 17, 2025
@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@jepett0 jepett0 requested a review from CyberROFL January 27, 2025 12:01
@jepett0 jepett0 marked this pull request as ready for review January 27, 2025 12:05
@CyberROFL CyberROFL requested a review from pixcc January 27, 2025 12:11
Copy link
Member

@CyberROFL CyberROFL left a comment

Choose a reason for hiding this comment

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

lgtm

@jepett0
Copy link
Contributor Author

jepett0 commented Jan 28, 2025

Fix merge conflict by rebasing to a fresh main.
Only 3 commits were added:

@github-actions

This comment was marked as outdated.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@jepett0 jepett0 requested a review from CyberROFL January 28, 2025 16:02
@github-actions
Copy link

github-actions bot commented Jan 28, 2025

2025-01-28 16:04:08 UTC Pre-commit check linux-x86_64-release-asan for 58f3834 has started.
2025-01-28 16:04:37 UTC Artifacts will be uploaded here
2025-01-28 16:08:27 UTC ya make is running...
🟡 2025-01-28 17:33:27 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet Going to retry failed tests...

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
13532 13460 0 26 14 32

2025-01-28 17:36:08 UTC ya make is running... (failed tests rerun, try 2)
🟡 2025-01-28 17:48:15 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet Going to retry failed tests...

Test history | Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
107 (only retried tests) 73 0 3 4 27

2025-01-28 17:48:29 UTC ya make is running... (failed tests rerun, try 3)
🟡 2025-01-28 17:59:56 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet

Test history | Ya make output | Test bloat | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
57 (only retried tests) 27 0 2 2 26

🟢 2025-01-28 18:00:07 UTC Build successful.
🟡 2025-01-28 18:00:36 UTC ydbd size 3.6 GiB changed* by +556.7 KiB, which is >= 100.0 KiB vs main: Warning

ydbd size dash main: faa5f83 merge: 58f3834 diff diff %
ydbd size 3 866 016 592 Bytes 3 866 586 632 Bytes +556.7 KiB +0.015%
ydbd stripped size 1 351 968 304 Bytes 1 352 084 720 Bytes +113.7 KiB +0.009%

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

@github-actions
Copy link

github-actions bot commented Jan 28, 2025

2025-01-28 16:07:46 UTC Pre-commit check linux-x86_64-relwithdebinfo for 58f3834 has started.
2025-01-28 16:12:04 UTC Artifacts will be uploaded here
2025-01-28 16:15:23 UTC ya make is running...
🟡 2025-01-28 20:21:52 UTC Some tests failed, follow the links below. Going to retry failed tests...

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
28035 25476 0 5 2423 131

2025-01-28 20:24:26 UTC ya make is running... (failed tests rerun, try 2)
🟢 2025-01-28 20:34:15 UTC Tests successful.

Test history | Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
205 (only retried tests) 87 0 0 0 118

🟢 2025-01-28 20:34:22 UTC Build successful.
🟡 2025-01-28 20:34:41 UTC ydbd size 2.1 GiB changed* by +367.8 KiB, which is >= 100.0 KiB vs main: Warning

ydbd size dash main: 0d933fd merge: 58f3834 diff diff %
ydbd size 2 224 838 968 Bytes 2 225 215 632 Bytes +367.8 KiB +0.017%
ydbd stripped size 470 365 616 Bytes 470 416 368 Bytes +49.6 KiB +0.011%

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

@CyberROFL CyberROFL mentioned this pull request Jan 28, 2025
2 tasks
Copy link
Collaborator

@pnv1 pnv1 left a comment

Choose a reason for hiding this comment

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

CLI part LGTM

@jepett0 jepett0 merged commit ee426f6 into ydb-platform:main Jan 29, 2025
12 checks passed
stanislav-shchetinin pushed a commit to stanislav-shchetinin/ydb that referenced this pull request Jan 30, 2025
azevaykin pushed a commit to azevaykin/ydb that referenced this pull request Feb 3, 2025
@jepett0 jepett0 linked an issue Feb 3, 2025 that may be closed by this pull request
2 tasks
jepett0 added a commit to jepett0/ydb that referenced this pull request Sep 22, 2025
jepett0 added a commit to jepett0/ydb that referenced this pull request Sep 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants