txthrottler: filter topology watcher by shard#13062
txthrottler: filter topology watcher by shard#13062timvaillancourt wants to merge 8 commits intovitessio:mainfrom
Conversation
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
If a new flag is being introduced:
If a workflow is added or modified:
Bug fixes
Non-trivial changes
New/Existing features
Backward compatibility
|
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
942cb6b to
d1fee85
Compare
harshit-gangal
left a comment
There was a problem hiding this comment.
the changes look good. A test would be needed to validate the enhancement.
|
This PR is being marked as stale because it has been open for 30 days with no activity. To rectify, you may do any of the following:
If no action is taken within 7 days, this PR will be closed. |
|
Bump to keep this open |
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
| topologyWatcherFactory = func(topoServer *topo.Server, hc discovery.HealthCheck, cell, keyspace, shard string, refreshInterval time.Duration, topoReadConcurrency int) TopologyWatcherInterface { | ||
| return discovery.NewCellTabletsWatcher(context.Background(), topoServer, hc, discovery.NewFilterByKeyspace([]string{keyspace}), cell, refreshInterval, true, topoReadConcurrency) | ||
| topologyWatcherFactory = func(topoServer *topo.Server, hc discovery.HealthCheck, cell, keyspace, shard string, refreshInterval time.Duration, topoReadConcurrency int) (TopologyWatcherInterface, error) { | ||
| cellTabletsFilter, err := discovery.NewFilterByShard([]string{fmt.Sprintf("%s|%s", keyspace, shard)}) |
There was a problem hiding this comment.
The conventional way to combine keyspace&shard is with /. Is there a reason the above uses | to separate them? If there's no particular reason, please accept the below suggestion:
| cellTabletsFilter, err := discovery.NewFilterByShard([]string{fmt.Sprintf("%s|%s", keyspace, shard)}) | |
| cellTabletsFilter, err := discovery.NewFilterByShard([]string{fmt.Sprintf("%s/%s", keyspace, shard)}) |
There was a problem hiding this comment.
@shlomi-noach for some reason discovery.NewFilterByShard uses | as a delimiter for filters. It's strange because later in that func the format you suggest is used in an error 😄
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
|
This PR is being marked as stale because it has been open for 30 days with no activity. To rectify, you may do any of the following:
If no action is taken within 7 days, this PR will be closed. |
|
Bumping to keep this open. I hope to add the unit test requested soon! |
|
This PR is being marked as stale because it has been open for 30 days with no activity. To rectify, you may do any of the following:
If no action is taken within 7 days, this PR will be closed. |
|
No longer required due to #14412 🎉. Closing |
Description
This PR filters the tablet watcher in
txthrottlerto return only tablets in the local shard because the Transaction Throttler has no need for the state of tablets in other shardsRelated Issue(s)
Resolves #13068
Checklist
Deployment Notes