Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release-24.2: roachtest: wait for propagation of tenant cluster settings #137937

Open
wants to merge 1 commit into
base: release-24.2
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 20 additions & 13 deletions pkg/cmd/roachtest/tests/mixed_version_change_replicas.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,20 +348,27 @@ func setTenantSetting(
return errors.Wrapf(err, "failed to set %s", name)
}

return testutils.SucceedsSoonError(func() error {
var currentValue bool
if err := h.QueryRow(r, fmt.Sprintf("SHOW CLUSTER SETTING %s", name)).Scan(&currentValue); err != nil {
return errors.Wrapf(err, "failed to retrieve setting %s", name)
}
// Wait for the setting to be visible to all nodes in the tenant.
for _, n := range h.Tenant.Descriptor.Nodes {
db := h.Tenant.Connect(n)
if err := testutils.SucceedsSoonError(func() error {
var currentValue bool
if err := db.QueryRow(fmt.Sprintf("SHOW CLUSTER SETTING %s", name)).Scan(&currentValue); err != nil {
return errors.Wrapf(err, "failed to retrieve setting %s", name)
}

if currentValue != value {
err := fmt.Errorf(
"waiting for setting %s: current (%t) != expected (%t)", name, currentValue, value,
)
l.Printf("%v", err)
return err
}

if currentValue != value {
err := fmt.Errorf(
"waiting for setting %s: current (%t) != expected (%t)", name, currentValue, value,
)
l.Printf("%v", err)
return nil
}); err != nil {
return err
}

return nil
})
}
return nil
}