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

gazctl: apply and edit take optional --max-txn-size #159

Closed
jgraettinger opened this issue Feb 15, 2019 · 2 comments
Closed

gazctl: apply and edit take optional --max-txn-size #159

jgraettinger opened this issue Feb 15, 2019 · 2 comments
Assignees
Labels

Comments

@jgraettinger
Copy link
Contributor

When applying very large updates, we run into Etcd's limit on the number of maximum keys in a single transaction.

That's because an apply is performed as a single Etcd transaction, meaning that either the entire change is made, or none of it is.

Etcd does expose this setting as a flag, and on the one hand the operator could elect to ramp this up to a sufficiently large value. That leaves intact the transactionality of gazctl apply.

However, this is awkward and there will be reasonable YAML specs which violate this limit no matter how large it is.

Another option is for gazctl apply to break up the total set of changes into a number of smaller RPCs / etcd transactions.

I think we let the user decide, by exposing a flag argument to control this behavior. If left at zero, the default, gazctl should attempt to apply the entire change as a single transaction, and return a contextualized etcd error if that violates the current server limit. Otherwise, gazctl should apply changes iteratively with at most --max-txn-size specs per RPC.

@jskelcy jskelcy added the to do label Feb 19, 2019
@rupertchen rupertchen changed the title gazctl: apply takes optional --max-txn-size gazctl: apply and edit take optional --max-txn-size Feb 19, 2019
@jskelcy jskelcy self-assigned this Feb 19, 2019
@jskelcy
Copy link

jskelcy commented Feb 19, 2019

I am thinking about this option and the case where there are some set of changes lined up and a change is landed in between them, which should be evident because the revision number has jumped by more than 1, and in this case, the apply/edit is abandoned. In this scenario we tell the user they need to attempt the command again after verifying that they still want the change. Does that seem too cumbersome to anyone?

@jgraettinger
Copy link
Contributor Author

which should be evident because the revision number has jumped by more than 1,

We can't assume anything at all about this case. It could be a completely unrelated update, or a valid reaction to the apply "chunk" that just completed (eg, replication factor was increased).

I don't believe the apply should be abandoned unless a chunk fails to apply. Each apply chunk already encodes the expected ModRevision values of each of the keys it's updating. If any have been updated in the meantime, the chunk will fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants