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

etcdctl: add --max-txn-ops flag to make-mirror command #14340

Merged
merged 1 commit into from
Aug 16, 2022
Merged

etcdctl: add --max-txn-ops flag to make-mirror command #14340

merged 1 commit into from
Aug 16, 2022

Conversation

xakdwch
Copy link
Contributor

@xakdwch xakdwch commented Aug 12, 2022

what is this

--max-txn-ops flag allows users to define the maximum number of operations permitted in
a transaction during syncing updates.if unlimited syncing may fail when number of txn ops
exceeds the maximum number of server side.

why need this

DefaultMaxTxnOps in server side is 128. it also can be defined by the --max-txn-ops flag in etcd server side.
if the number of operations permitted per transaction exceeds the limitation during make-mirror,
make-mirror will crash.

2022/08/12 14:58:44 INFO: [core] [Channel #3 SubChannel #4] Subchannel Connectivity change to IDLE
2022/08/12 14:58:44 INFO: [balancer] base.baseBalancer: handle SubConn state change: 0xc00057c550, IDLE
2022/08/12 14:58:44 INFO: [transport] transport: loopyWriter.run returning. connection error: desc = "transport is closing"
2022/08/12 14:58:44 INFO: [roundrobin] roundrobinPicker: Build called with info: {map[]}
2022/08/12 14:58:44 INFO: [core] [Channel #3] Channel Connectivity change to IDLE
2022/08/12 14:58:44 INFO: [core] [Channel #3 SubChannel #4] Subchannel Connectivity change to CONNECTING
2022/08/12 14:58:44 INFO: [core] [Channel #3 SubChannel #4] Subchannel picks a new address "10.20.144.27:2379" to connect
2022/08/12 14:58:44 INFO: [balancer] base.baseBalancer: handle SubConn state change: 0xc00057c550, CONNECTING
2022/08/12 14:58:44 INFO: [core] [Channel #3] Channel Connectivity change to CONNECTING
2022/08/12 14:58:44 INFO: [core] [Channel #3 SubChannel #4] Subchannel Connectivity change to READY
2022/08/12 14:58:44 INFO: [balancer] base.baseBalancer: handle SubConn state change: 0xc00057c550, READY
2022/08/12 14:58:44 INFO: [roundrobin] roundrobinPicker: Build called with info: {map[0xc00057c550:{{
"Addr": "10.20.144.27:2379",
"ServerName": "10.20.144.27",
"Attributes": null,
"BalancerAttributes": null,
"Type": 0,
"Metadata": null
}}]}
2022/08/12 14:58:44 INFO: [core] [Channel #3] Channel Connectivity change to READY
17313
{"level":"warn","ts":"2022-08-12T14:59:21.543+0800","logger":"etcd-client","caller":"v3/retry_interceptor.go:64","msg":"retrying of unary invoker failed","target":"etcd-endpoints://0xc0001c85a0/192.168.48.220:2379","method":"/etcdserverpb.KV/Txn","attempt":0,"error":"rpc error: code = InvalidArgument desc = etcdserver: too many operations in txn request"}
Error: etcdserver: too many operations in txn request

Please read https://github.com/etcd-io/etcd/blob/main/CONTRIBUTING.md#contribution-flow.

@xakdwch xakdwch changed the title etcdctl: add --max-txn-ops flag etcdctl: add --max-txn-ops flag to make-mirror command Aug 12, 2022
etcdctl/ctlv3/command/make_mirror_command.go Outdated Show resolved Hide resolved
etcdctl/ctlv3/command/make_mirror_command.go Outdated Show resolved Hide resolved
etcdctl/ctlv3/command/make_mirror_command.go Outdated Show resolved Hide resolved
@ahrtr
Copy link
Member

ahrtr commented Aug 13, 2022

Overall looks good to me, but please keep it consistent with the existing flag in etcd

Copy link
Member

@ahrtr ahrtr left a comment

Choose a reason for hiding this comment

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

LGTM

Thank you @xakdwch

cc @spzala

@ahrtr
Copy link
Member

ahrtr commented Aug 15, 2022

Please also add an item into the changelog-3.6

Copy link
Member

@spzala spzala left a comment

Choose a reason for hiding this comment

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

Thanks @xakdwch We should update README as well - https://github.com/etcd-io/etcd/blob/main/etcdctl/README.md#make-mirror-options-destination Also, as @ahrtr pointed out, please update the CHANGELOG.

--max-txn-ops flag allows users to define the maximum number of operations permitted in
a transaction during syncing updates.if unlimited syncing may fail when number of txn ops
exceeds the maximum number of server side.

Signed-off-by: xakdwch <xakdwch5@gmail.com>
@xakdwch
Copy link
Contributor Author

xakdwch commented Aug 15, 2022

Thanks @xakdwch We should update README as well - https://github.com/etcd-io/etcd/blob/main/etcdctl/README.md#make-mirror-options-destination Also, as @ahrtr pointed out, please update the CHANGELOG.

Thanks @xakdwch We should update README as well - https://github.com/etcd-io/etcd/blob/main/etcdctl/README.md#make-mirror-options-destination Also, as @ahrtr pointed out, please update the CHANGELOG.

ack and updated

@xakdwch
Copy link
Contributor Author

xakdwch commented Aug 15, 2022

Please also add an item into the changelog-3.6

updated

@xakdwch xakdwch requested a review from spzala August 15, 2022 08:07
Copy link
Member

@spzala spzala left a comment

Choose a reason for hiding this comment

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

Thanks @xakdwch
lgtm. The build failure not related, re-running.

@ahrtr ahrtr merged commit ff6b85d into etcd-io:main Aug 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants