Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

fix unified perms oob migrator#50147

Merged
kopancek merged 1 commit intomainfrom
milan/fix_unified_perms_migrator
Mar 30, 2023
Merged

fix unified perms oob migrator#50147
kopancek merged 1 commit intomainfrom
milan/fix_unified_perms_migrator

Conversation

@kopancek
Copy link
Contributor

@kopancek kopancek commented Mar 30, 2023

Turns out our progress was not reporting correctly, because certain rows were not migrated. This was caused by bad query in migrator itself, because if there were no permissions (empty object_ids_ints array), we had no rows in the s set of the subquery. This s subquery was subsequently used to update the migrated column, but we should have instead used the candidates subquery.

Hope the description makes sense, code change should be self explanatory.

Test plan

  • Unit tested
  • Verify on S2 that this is the case

@kopancek kopancek requested a review from a team March 30, 2023 08:19
@kopancek kopancek self-assigned this Mar 30, 2023
@cla-bot cla-bot bot added the cla-signed label Mar 30, 2023
Copy link
Contributor

@mrnugget mrnugget left a comment

Choose a reason for hiding this comment

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

Do we need to backport this?

Comment on lines +169 to +171
for i := 0; i < 10; i++ {
err = migrator.Up(ctx)
require.NoError(t, err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this correct, calling migrator.Up 10 times?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, if you look at the Up implementation, it only executes the SQL query, nothing else.

@kopancek kopancek merged commit 9056cbd into main Mar 30, 2023
@kopancek kopancek deleted the milan/fix_unified_perms_migrator branch March 30, 2023 10:28
github-actions bot pushed a commit that referenced this pull request Mar 30, 2023
Turns out our progress was not reporting correctly, because certain rows
were not migrated. This was caused by bad query in migrator itself,
because if there were no permissions (empty `object_ids_ints` array), we
had no rows in the `s` set of the subquery. This `s` subquery was
subsequently used to update the `migrated` column, but we should have
instead used the `candidates` subquery.

Hope the description makes sense, code change should be self
explanatory.

## Test plan

- [x] Unit tested
- [x] Verify on S2 that this is the case

(cherry picked from commit 9056cbd)
coury-clark pushed a commit that referenced this pull request Mar 30, 2023
Turns out our progress was not reporting correctly, because certain rows
were not migrated. This was caused by bad query in migrator itself,
because if there were no permissions (empty `object_ids_ints` array), we
had no rows in the `s` set of the subquery. This `s` subquery was
subsequently used to update the `migrated` column, but we should have
instead used the `candidates` subquery.

Hope the description makes sense, code change should be self
explanatory.

## Test plan

- [x] Unit tested
- [x] Verify on S2 that this is the case
 <br> Backport 9056cbd from #50147

Co-authored-by: Milan Freml <kopancek@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants