Skip to content

test: refresh permissions between table creation - #4892

Merged
Michal-Leszczynski merged 1 commit into
masterfrom
ml/grant-test-permissions-more-often
Jul 28, 2026
Merged

test: refresh permissions between table creation#4892
Michal-Leszczynski merged 1 commit into
masterfrom
ml/grant-test-permissions-more-often

Conversation

@Michal-Leszczynski

Copy link
Copy Markdown
Collaborator

TestRestoreFullChangingMethodIntegration behaved flaky recently. Even though a few initial restore table could succeed, it could fail on the last one on permissions' error.

In this test, we drop and re-create the tables constantly. This also drops their permissions configuration.
The test worked because the same user also re-created those tables and was granted all their permissions by default. It might be that such permissions are not instantly propagated to all other nodes and depending on which node the alter schema query is routed to, the test might fail.

To fix that, we could either make an explicit raft read barrier on all nodes, or just re-apply the needed permissions, as explicit permissions changes also result in raft read barrier being performed underneath. I chose the second approach, because it requires only a single API call and is more explicit in terms of what permissions are expected from the restore user instead of relying on the default permissions granted on schema restore.

Fixes https://scylladb.atlassian.net/browse/CLOUD-3264

TestRestoreFullChangingMethodIntegration behaved flaky recently.
Even though a few initial restore table could succeed, it could
fail on the last one on permissions' error.

In this test, we drop and re-create the tables constantly.
This also drops their permissions configuration.
The test worked because the same user also re-created those
tables and was granted all their permissions by default.
It might be that such permissions are not instantly
propagated to all other nodes and depending on which node
the alter schema query is routed to, the test might fail.

To fix that, we could either make an explicit raft read barrier
on all nodes, or just re-apply the needed permissions,
as explicit permissions changes also result in raft read barrier
being performed underneath. I chose the second approach,
because it requires only a single API call and is more explicit
in terms of what permissions are expected from the restore user
instead of relying on the default permissions granted on schema restore.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Refreshes restore-user permissions after each schema recreation to prevent flaky permission failures.

Changes:

  • Moves table permission grants into each restore iteration.
  • Applies permissions immediately before restoring table data.

Integration-test requirements remain satisfied; coverage is not reduced. No user-facing documentation changes are needed.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Michal-Leszczynski
Michal-Leszczynski marked this pull request as ready for review July 28, 2026 12:58
@Michal-Leszczynski
Michal-Leszczynski merged commit 27e0449 into master Jul 28, 2026
85 of 86 checks passed
@Michal-Leszczynski
Michal-Leszczynski deleted the ml/grant-test-permissions-more-often branch July 28, 2026 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants