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

Add database admin scan command #3165

Merged
merged 28 commits into from
Apr 7, 2020
Merged

Add database admin scan command #3165

merged 28 commits into from
Apr 7, 2020

Conversation

andrewjdawson2016
Copy link
Contributor

Added admin db scan command. And ListConcreteExecutions API to persistence.

This script is useful to detect data inconsistency.

If the rates used are too high it can interfere with production database access.

@coveralls
Copy link

coveralls commented Apr 3, 2020

Coverage Status

Coverage decreased (-0.1%) to 68.878% when pulling aa34538 on dbAdmin into ffc2f55 on master.

Comment on lines 42 to 44
scanWorkerCount = 40
numberOfShards = 16384
delayBetweenExecutionPages = 50 * time.Millisecond
Copy link
Contributor

Choose a reason for hiding this comment

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

could we make the first three configurable via CLI?
The scanWorkerCount and delayBetweenExecutionPages controls the QPS. As we exposed this, it would be better to be configurable as the db cluster could be different.

numberOfShards is based on the application config. So the operator can pass this in via CLI

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good - will do.

Comment on lines 257 to 667
if combined.ShardID < report.ShardID {
combined.ShardID = report.ShardID
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't quite understand this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will address.

combinedShardReport := &ScanShardReport{}
for i := 0; i < numberOfShards; i++ {
report := <-shardReports
combineShardReport(report, combinedShardReport)
Copy link
Contributor

Choose a reason for hiding this comment

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

what exactly is combined report ? why is it emitted for each shard ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seems like this is confusing to multiple people. I will rethink how progress is reported.

const (
scanWorkerCount = 40
numberOfShards = 16384
delayBetweenExecutionPages = 50 * time.Millisecond
Copy link
Contributor

Choose a reason for hiding this comment

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

I would prefer using a ratelimit (that is configurable with sane default) instead of this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will make this change. Will use a dynamic rate limiter which starts at a low rps and over the course of X seconds moves to target rps.


const (
scanWorkerCount = 40
numberOfShards = 16384
Copy link
Contributor

Choose a reason for hiding this comment

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

this is not true for all clusters. Can be a default, but would prefer this to be configurable as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point.

@andrewjdawson2016 andrewjdawson2016 merged commit aefcfee into master Apr 7, 2020
@andrewjdawson2016 andrewjdawson2016 deleted the dbAdmin branch April 7, 2020 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants