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

Allow revision filters on delete ops #18187

Open
Alfus opened this issue Jun 17, 2024 · 0 comments
Open

Allow revision filters on delete ops #18187

Alfus opened this issue Jun 17, 2024 · 0 comments
Labels
area/clientv3 priority/backlog Higher priority than priority/awaiting-more-evidence. type/feature

Comments

@Alfus
Copy link

Alfus commented Jun 17, 2024

What would you like to be added?

I would like to be able to use clientv3.WithMaxModRev with clientv3.OpDelete.

Why is this needed?

I'd like to make deletes truly idempotent, by only deleting the value if it was the one read. For example, if a range of entries are read at revision R, it would be nice to only delete an entry if it's revision has not changed since R. I could use a transaction for this, but I am already using a txn to avoid errors.ErrTooManyRequests (see #18175).
Consider the following sequence of events:

  1. K1..KN are written at R1
  2. K1..KN are read at R2
  3. K1..KN are deleted in a single txn (to avoid errors.ErrTooManyRequests and maxGapBetweenApplyAndCommitIndex #18175)
  4. KX is written at R3, where 1 <= X <= N
  5. The operation at (2) is retried, deleting KX@R3 by mistake!

More generally speaking it would be nice to support the rev filters on delete ops, so a key and revision combo can be specified for the delete.

I also have the use case where I would like to delete all the values before a specific revision for a given prefix. To do this right now, I have to list the keys with the revision filters, then delete each key. It would be much nicer to be able to just send a delete request for the prefix with the revision filters.

Thanks!

@jmhbnz jmhbnz added the priority/backlog Higher priority than priority/awaiting-more-evidence. label Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/clientv3 priority/backlog Higher priority than priority/awaiting-more-evidence. type/feature
Development

No branches or pull requests

2 participants