This repository was archived by the owner on Dec 9, 2024. It is now read-only.
Open
Conversation
Signed-off-by: yisaer <disxiaofei@163.com> add stale-read test Signed-off-by: yisaer <disxiaofei@163.com> add stale-read test Signed-off-by: yisaer <disxiaofei@163.com>
e9d1016 to
ccb97e0
Compare
Signed-off-by: yisaer <disxiaofei@163.com>
Signed-off-by: yisaer <disxiaofei@163.com>
4a73dd9 to
a88ccf0
Compare
JmPotato
reviewed
Jun 8, 2021
Comment on lines
97
to
107
| setSQL := fmt.Sprintf(`SET TRANSACTION READ ONLY as of timestamp tidb_bounded_staleness('%v', '%v')`, previousStr, nowStr) | ||
| _, err := db.Exec(setSQL) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| rows, err := db.Query("select id, k, c, pad from sbtest0 where k in (?, ?, ?)", rand.Intn(num), rand.Intn(num), rand.Intn(num)) | ||
| defer rows.Close() | ||
| if err != nil { | ||
| return errors.WithStack(err) | ||
| } | ||
| return nil |
Contributor
Author
There was a problem hiding this comment.
we don't need to commit here.
testcase/stale-read/bench.go
Outdated
| return nil | ||
| } | ||
|
|
||
| func (c *SysbenchCase) executeSelect(db *sql.DB) error { |
Member
There was a problem hiding this comment.
I think a prepare test case is needed after pingcap/tidb#25156 is merged.
Contributor
Author
There was a problem hiding this comment.
we can add it after tidb#25156 merged.
testcase/stale-read/bench.go
Outdated
| func (c *SysbenchCase) executeSelect(db *sql.DB) error { | ||
| num := c.insertCount * c.rowsEachInsert | ||
| now := time.Now() | ||
| previous := now.Add(-3 * time.Second) |
Member
There was a problem hiding this comment.
What about making the staleness second 3s configurable as a cmd flag?
| } | ||
|
|
||
| // TODO: assert store read bytes/keys metrics | ||
| func handleStoreMetricsValue(smvms map[string][]StoreMetricsValue, duration time.Duration) { |
Member
There was a problem hiding this comment.
What are you going to do with these metrics data?
Contributor
Author
There was a problem hiding this comment.
asserting the key/byte loads of store is close with each other.
Signed-off-by: yisaer <disxiaofei@163.com>
JmPotato
reviewed
Jun 10, 2021
testcase/stale-read/bench.go
Outdated
| return nil | ||
| } | ||
|
|
||
| func (c *SysbenchCase) executeSelect(db *sql.DB) error { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
What is changed and how does it work?
Check List
Add stale-read testcases.
Does this PR introduce a user-facing change?: