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

KVStore: Fix test of async tasks #8928

Merged
merged 5 commits into from
Apr 10, 2024
Merged

Conversation

CalvinNeo
Copy link
Member

@CalvinNeo CalvinNeo commented Apr 10, 2024

What problem does this PR solve?

Issue Number: close #8926

Problem Summary:

What is changed and how it works?

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

None

Signed-off-by: CalvinNeo <[email protected]>
@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-linked-issue release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed do-not-merge/needs-linked-issue labels Apr 10, 2024
@CalvinNeo CalvinNeo requested review from JaySon-Huang and Lloyd-Pottiger and removed request for JaySon-Huang April 10, 2024 08:38
Comment on lines +439 to +443
buffer.joinStr(
query_info.bypass_lock_ts->begin(),
query_info.bypass_lock_ts->end(),
[](const auto & v, FmtBuffer & f) { f.fmtAppend("{}", v); },
"|");
Copy link
Contributor

Choose a reason for hiding this comment

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

[v, v, v, ...] seems more clear?

Copy link
Member Author

Choose a reason for hiding this comment

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

"," is used outside

Copy link
Contributor

Choose a reason for hiding this comment

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

do not have []

Copy link
Contributor

Choose a reason for hiding this comment

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

Why not fmt::format("{}", *bypass_lock_ts) directly.

Copy link
Member Author

Choose a reason for hiding this comment

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

"," is used outside

Copy link
Contributor

Choose a reason for hiding this comment

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

Elements of a vector/set will be enclosed by [].

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

Comment on lines 76 to 88
FmtBuffer buffer;
buffer.append("ids=");
buffer.joinStr(
ids.begin(),
ids.end(),
[](const auto & v, FmtBuffer & f) { f.fmtAppend("{}", v); },
"|");
buffer.append(" locks=");
buffer.joinStr(
region_locks.begin(),
region_locks.end(),
[](const auto & v, FmtBuffer & f) { f.fmtAppend("{}({})", v.first, v.second->DebugString()); },
"|");
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

Copy link
Contributor

Choose a reason for hiding this comment

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

We can implement a fmt::formatter for std:: pair<RegionID, LockInfoPtr>, element type of region_locks. This way, this function can be simplified as follows:

fmt::format("ids={}, locks={}", ids, region_locks);

Copy link
Member Author

Choose a reason for hiding this comment

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

Will fix it in later pr

dbms/src/Storages/KVStore/tests/gtest_async_tasks.cpp Outdated Show resolved Hide resolved
z
Signed-off-by: CalvinNeo <[email protected]>
f
Signed-off-by: CalvinNeo <[email protected]>
@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Apr 10, 2024
@CalvinNeo
Copy link
Member Author

/run-all-tests

@ti-chi-bot ti-chi-bot bot added the lgtm label Apr 10, 2024
Copy link
Contributor

ti-chi-bot bot commented Apr 10, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JinheLin, Lloyd-Pottiger

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

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [JinheLin,Lloyd-Pottiger]

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 Apr 10, 2024
Copy link
Contributor

ti-chi-bot bot commented Apr 10, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-04-10 09:57:14.429125188 +0000 UTC m=+1042695.956665735: ☑️ agreed by Lloyd-Pottiger.
  • 2024-04-10 10:09:54.959751008 +0000 UTC m=+1043456.487291554: ☑️ agreed by JinheLin.

@CalvinNeo
Copy link
Member Author

/hold

@ti-chi-bot ti-chi-bot bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 10, 2024
d
Signed-off-by: CalvinNeo <[email protected]>
@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 Apr 10, 2024
@CalvinNeo
Copy link
Member Author

/run-all-tests

@CalvinNeo
Copy link
Member Author

/unhold

@ti-chi-bot ti-chi-bot bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 10, 2024
d
Signed-off-by: CalvinNeo <[email protected]>
@CalvinNeo
Copy link
Member Author

/run-all-tests

@CalvinNeo
Copy link
Member Author

[2024/04/10 18:23:30.425 +08:00] [DEBUG] [LearnerReadWorker.cpp:469] ["[Learner Read] Learner Read Summary, regions_info=(id:52287208 applied_index:1059999 bypass_locks:[]), unavailable_regions_info={ids=[] locks=[]}"] [source="Coprocessor, is_remote_read: true, start_ts: 448985722424393747, region_info: {52287208, 6, 2181}"] [thread_id=564]

@CalvinNeo
Copy link
Member Author

/run-integration-test

@CalvinNeo
Copy link
Member Author

024-04-10T11:08:27.105Z] + docker-compose -f cluster.yaml -f tiflash-dt-sync-grpc.yaml down
[2024-04-10T11:08:27.105Z] Stopping fullstack-test_tidb0_1    ... 
[2024-04-10T11:08:27.105Z] Stopping fullstack-test_tiflash0_1 ... 
[2024-04-10T11:08:27.105Z] Stopping fullstack-test_tikv0_1    ... 
[2024-04-10T11:08:27.105Z] Stopping fullstack-test_pd0_1      ... 
[2024-04-10T11:09:31.423Z] �[3A�[2K
Stopping fullstack-test_tiflash0_1 ... �[31merror�[0m
�[3B�[1A�[2K
Stopping fullstack-test_pd0_1      ... �[31merror�[0m
�[1B�[2A�[2K
Stopping fullstack-test_tikv0_1    ... �[31merror�[0m
�[2B�[4A�[2K
Stopping fullstack-test_tidb0_1    ... �[32mdone�[0m
�[4B
[2024-04-10T11:09:31.423Z] ERROR: for fullstack-test_tiflash0_1  cannot stop container: 45d73a47f5aba8b6ec6a12dbd4758aaf5696e8b190b472c2c1d115126b6c508c: tried to kill container, but did not receive an exit event
[2024-04-10T11:09:31.423Z] Removing fullstack-test_tidb0_1    ... 
[2024-04-10T11:09:31.423Z] Removing fullstack-test_tiflash0_1 ... 
[2024-04-10T11:09:31.423Z] �[2A�[2K
Removing fullstack-test_tidb0_1    ... �[32mdone�[0m
�[2B�[1A�[2K
Removing fullstack-test_tiflash0_1 ... �[32mdone�[0m
�[1BRemoving network fullstack-test_default
[2024-04-10T11:09:31.423Z] error while removing network: network fullstack-test_default id 3d7dd9b808db2fb7bf49e01637cf4e15f1c37cb899d48bbd534ce2b211192db3 has active endpoints
[2024-04-10T11:09:31.438Z] [Pipeline] sh
[2024-04-10T11:09:32.279Z] + docker ps -a
[2024-04-10T11:09:32.279Z] CONTAINER ID        IMAGE                            COMMAND                  CREATED             STATUS              PORTS               NAMES
[2024-04-10T11:09:32.279Z] cc06f80976e0        hub.pingcap.net/qa/tikv:master   "/tikv-server --addr…"   9 minutes ago       Up 9 minutes        20160/tcp           fullstack-test_tikv0_1
[2024-04-10T11:09:32.279Z] 5d664c8adf6d        hub.pingcap.net/qa/pd:master     "/pd-server --name=p…"   9 minutes ago       Up 9 minutes        2379-2380/tcp       fullstack-test_pd0_1
[2024-04-10T11:09:32.279Z] + mv log fullstack-test-log
[2024-04-10T11:09:32.279Z] + find fullstack-test-log -name '*.log'
[2024-04-10T11:09:32.279Z] + xargs tail -n 500

@ti-chi-bot ti-chi-bot bot merged commit 8cec573 into pingcap:master Apr 10, 2024
6 checks passed
JaySon-Huang pushed a commit to ti-chi-bot/tiflash that referenced this pull request Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none Denotes a PR that doesn't merit a release note. 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.

AsyncTasksNormal assertion fires
3 participants