Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

Reduce the number of operations written to the etcd storage in a single transaction #122

Open
ZuLiangWang opened this issue Dec 16, 2022 · 0 comments

Comments

@ZuLiangWang
Copy link
Contributor

In current etcd storage implementation, it will write and query the metadata of the cluster and shard with transaction containing multiple operations, like this:

	for _, shardView := range req.ShardViews {
		opCreateShardTopologiesAndLatestVersion = append(opCreateShardTopologiesAndLatestVersion, clientv3.OpPut(key, string(value)), clientv3.OpPut(latestVersionKey, fmtID(shardView.Version)))
	}
	resp, err := s.client.Txn(ctx).
		If(keysMissing...).
		Then(opCreateShardTopologiesAndLatestVersion...).
		Commit()

An error occurs when the number of operations exceeds the maximum limit of etcd.
Try to optimize these writing methods to reduce the number of operations under the same data volume.

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

No branches or pull requests

1 participant