Skip to content

[release-3.5] server: keep auth applier when an alarm is raised - #22386

Open
vivekpatani wants to merge 1 commit into
etcd-io:release-3.5from
vivekpatani:fix/alarm-preserve-auth-applier
Open

vivekpatani wants to merge 1 commit into
etcd-io:release-3.5from
vivekpatani:fix/alarm-preserve-auth-applier

Conversation

@vivekpatani

@vivekpatani vivekpatani commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

etcd uses a chain of appliers to apply each request. The auth applier is the first item in the chain. It checks permissions.

When the database becomes full, etcd sets the NOSPACE alarm. The alarm handler then builds a new chain. The new chain is not correct. It does not contain the auth applier.

While the alarm is active, etcd does not check permissions for these operations:

  • AuthDisable, AuthEnable, and all user and role operations
  • DeleteRange
  • LeaseRevoke

A user needs write permission for only one key prefix. The user writes data to that prefix until the database is full. This makes the alarm active. The user can then stop authentication for the cluster.

Note:

  • Read operations are safe. Read operations do not use this chain.
  • The same problem is not present in 3.6 and later versions.

Steps to reproduce

  1. Start a cluster with one member.
  2. Add a user with the name tenant. Give the user a role. The role gives read and write permission for the keys from /tenant/ to /tenant0.
  3. Add the root user. Then enable authentication.
  4. As the root user, write the key /secret/key.
  5. Set --quota-backend-bytes to a small value. Then restart the member.
  6. As the tenant user, do these three operations:
    • read /secret/key
    • delete /secret/key
    • AuthDisable
  7. As the tenant user, write 8 KB of data to the key /tenant/fill. Repeat this step until etcd shows the error database space exceeded.
  8. Do step 6 again.

Result: In step 6, etcd refuses all three operations. In step 8, etcd refuses the read operation, but etcd permits the delete operation and the AuthDisable operation.

Expected result: etcd refuses all three operations in step 8.

@vivekpatani

Copy link
Copy Markdown
Contributor Author

/retest

1 similar comment
@vivekpatani

Copy link
Copy Markdown
Contributor Author

/retest

@fuweid

fuweid commented Sep 10, 2026

Copy link
Copy Markdown
Member

cc @lavacat

@fuweid fuweid changed the title server: keep auth applier when an alarm is raised [release-3.5] server: keep auth applier when an alarm is raised Sep 10, 2026

@lavacat lavacat 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.

LGTM
I don't think this is an issue in etcd 3.6 since there was a large refactor to use uberApplier

Comment thread tests/integration/v3_alarm_test.go Outdated
@kubernetes-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: lavacat, vivekpatani
Once this PR has been reviewed and has the lgtm label, please assign wenjiaswe for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Signed-off-by: vivekpatani <9080894+vivekpatani@users.noreply.github.com>
@vivekpatani
vivekpatani force-pushed the fix/alarm-preserve-auth-applier branch from ad758c2 to 4c29296 Compare September 17, 2026 04:51
@vivekpatani

Copy link
Copy Markdown
Contributor Author

The pull-etcd-govulncheck is due to go-grpc, waiting to get approval to submit a fix.

@ahrtr @ivanvc @lavacat @fuweid

@vivekpatani

Copy link
Copy Markdown
Contributor Author

/restest

@kubernetes-prow

Copy link
Copy Markdown

@vivekpatani: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-etcd-govulncheck 4c29296 link true /test pull-etcd-govulncheck
pull-etcd-integration-2-cpu-arm64 4c29296 link true /test pull-etcd-integration-2-cpu-arm64
pull-etcd-integration-2-cpu-amd64 4c29296 link true /test pull-etcd-integration-2-cpu-amd64
pull-etcd-integration-1-cpu-arm64 4c29296 link true /test pull-etcd-integration-1-cpu-arm64
pull-etcd-integration-4-cpu-arm64 4c29296 link true /test pull-etcd-integration-4-cpu-arm64

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@ahrtr

ahrtr commented Sep 17, 2026

Copy link
Copy Markdown
Member

can you try to make all workflow green?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

4 participants