-
Notifications
You must be signed in to change notification settings - Fork 229
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
Introduce the RURuntimeStats #732
Conversation
5dc1b0a
to
24b675b
Compare
Signed-off-by: JmPotato <ghzpotato@gmail.com>
Signed-off-by: JmPotato <ghzpotato@gmail.com>
Signed-off-by: JmPotato <ghzpotato@gmail.com>
Signed-off-by: JmPotato <ghzpotato@gmail.com>
Signed-off-by: JmPotato <ghzpotato@gmail.com>
bd50ebb
to
ed68b15
Compare
Signed-off-by: JmPotato <ghzpotato@gmail.com>
ed68b15
to
21aa2e2
Compare
Signed-off-by: JmPotato <ghzpotato@gmail.com>
Signed-off-by: JmPotato <ghzpotato@gmail.com>
a189b02
to
24cc6df
Compare
Signed-off-by: JmPotato <ghzpotato@gmail.com>
24cc6df
to
249992d
Compare
txnkv/txnsnapshot/snapshot.go
Outdated
@@ -391,6 +391,7 @@ func (s *KVSnapshot) batchGetSingleRegion(bo *retry.Backoffer, batch batchKeys, | |||
Keys: pending, | |||
Version: s.version, | |||
}, s.mu.replicaRead, &s.replicaReadSeed, kvrpcpb.Context{ | |||
StartTs: s.version, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the places that you set StartTs
are just a copy of start version in each type of command. How about getting the start ts with a match of the request type instead of adding a new field in context
} | ||
|
||
func (r interceptedClient) SendRequest(ctx context.Context, addr string, req *tikvrpc.Request, timeout time.Duration) (*tikvrpc.Response, error) { | ||
// Build the resource control interceptor. | ||
resourceGroupName := req.GetResourceGroupName() | ||
var finalInterceptor interceptor.RPCInterceptor = buildResourceControlInterceptor(ctx, req, resourceGroupName) | ||
var finalInterceptor interceptor.RPCInterceptor = buildResourceControlInterceptor(ctx, req, r.getRURuntimeStats(req.GetStartTs())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder point get
use same ts, if run point get workload and run a explain analazy
may get wrong result?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked the TiDB code and found that the point get inside an EXPLAIN ANALYZE
would not use max uint64 due to the following code:
It will not be regarded as a pure point get since it's an EXPLAIN
SQL after all. So its start_ts
will remain unique.
ca9bc61
to
c948aa9
Compare
Signed-off-by: JmPotato <ghzpotato@gmail.com>
c948aa9
to
d793ffa
Compare
/cc @tiancaiamao @glorv @nolouch @Connor1996 PTAL again, thx! |
Signed-off-by: JmPotato <ghzpotato@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm. ptal @Connor1996
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Ref pingcap/tidb#41972. Should merge after
pingcap/kvproto#1073 andtikv/pd#6125.Before
EXPLAIN ANALYZE
is executed, it will setRURuntimeStats
with itsstart_ts
, then theOnRequest
andOnResponse
could get the correspondingRURuntimeStats
and update its RU info.