Skip to content

Support blocklisting TiFlash WN node#198

Merged
ti-chi-bot[bot] merged 7 commits intotikv:masterfrom
CalvinNeo:blacklist
Nov 1, 2024
Merged

Support blocklisting TiFlash WN node#198
ti-chi-bot[bot] merged 7 commits intotikv:masterfrom
CalvinNeo:blacklist

Conversation

@CalvinNeo
Copy link
Member

No description provided.

@ti-chi-bot ti-chi-bot bot added dco-signoff: yes Indicates the PR's author has signed the dco. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Oct 28, 2024
bool is_partition_table_scan,
const std::vector<int64_t> & physical_table_ids,
const std::vector<KeyRanges> & ranges_for_each_physical_table,
const std::unordered_set<uint64_t> * store_id_blacklist,
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO store_id_blocklist is better.

Copy link
Member Author

Choose a reason for hiding this comment

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

OK, I got your point here...

Copy link
Contributor

Choose a reason for hiding this comment

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

Add some test cases about the new filter logic

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

StoreNotReady));
continue;
}
if (store_id_blacklist && store_id_blacklist->count(store.id) > 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

format the files

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

if (cached_region == nullptr)
{
all_stores.emplace_back(current_store.id);
remove_blacklist(store_id_blacklist, all_stores, region_id, log);
Copy link
Contributor

Choose a reason for hiding this comment

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

After you added this logic, the function RegionCache::getAllValidTiFlashStores now may return all_stores with an empty set? Can the caller handle this situation?

Copy link
Member Author

@CalvinNeo CalvinNeo Oct 31, 2024

Choose a reason for hiding this comment

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

Yes, it is tested in https://github.com/tidbcloud/tiflash-cse/pull/308 where none of the two wn nodes can be selected. Basicly, getAllValidTiFlashStores is to get all valid stores to do some balance work, whereas the "effective" store is returned by getRPCContext

@ti-chi-bot ti-chi-bot bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 31, 2024
@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Oct 31, 2024
CalvinNeo and others added 6 commits October 31, 2024 13:40
Signed-off-by: Calvin Neo <calvinneo1995@gmail.com>
Signed-off-by: Calvin Neo <calvinneo1995@gmail.com>
Signed-off-by: Calvin Neo <calvinneo1995@gmail.com>
Signed-off-by: Calvin Neo <calvinneo1995@gmail.com>

Update include/pingcap/kv/RegionClient.h

Co-authored-by: JaySon <tshent@qq.com>
Signed-off-by: Calvin Neo <calvinneo1995@gmail.com>
Signed-off-by: Calvin Neo <calvinneo1995@gmail.com>
@ti-chi-bot
Copy link

ti-chi-bot bot commented Oct 31, 2024

@guo-shaoge: adding LGTM is restricted to approvers and reviewers in OWNERS files.

Details

In response to this:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

if (cached_region == nullptr)
{
all_stores.emplace_back(current_store.id);
remove_blocklist(store_id_blocklist, all_stores, region_id, log);
Copy link
Contributor

Choose a reason for hiding this comment

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

balanceBatchCopTasks may meet out-of-index in this line.

auto task_store_id = task.region_infos[0].all_stores[0];

Copy link
Member Author

Choose a reason for hiding this comment

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

In buildBatchCopTasks, if no store can be selected, it won't go that far. It will throw an exception in backoffer because getRPCContext returns none.

Copy link
Member Author

Choose a reason for hiding this comment

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

I have add an Exception here. Moreover, the most common path is is_mpp=true

a
Signed-off-by: Calvin Neo <calvinneo1995@gmail.com>
@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 31, 2024
@ti-chi-bot
Copy link

ti-chi-bot bot commented Nov 1, 2024

@JaySon-Huang: adding LGTM is restricted to approvers and reviewers in OWNERS files.

Details

In response to this:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@CalvinNeo CalvinNeo changed the title Support blacklisting TiFlash WN node Support blocklisting TiFlash WN node Nov 1, 2024
@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Nov 1, 2024
@ti-chi-bot ti-chi-bot bot added the lgtm label Nov 1, 2024
@ti-chi-bot
Copy link

ti-chi-bot bot commented Nov 1, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gengliqi, guo-shaoge, JaySon-Huang, LykxSassinator

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [LykxSassinator,gengliqi]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot removed the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Nov 1, 2024
@ti-chi-bot
Copy link

ti-chi-bot bot commented Nov 1, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-11-01 08:27:52.179115917 +0000 UTC m=+597585.018271456: ☑️ agreed by gengliqi.
  • 2024-11-01 08:34:35.898691053 +0000 UTC m=+597988.737846599: ☑️ agreed by LykxSassinator.

@ti-chi-bot ti-chi-bot bot merged commit be7045d into tikv:master Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved dco-signoff: yes Indicates the PR's author has signed the dco. lgtm size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants