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
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
e365f7a
Start db admin operation
andrewjdawson2016 Apr 2, 2020
0796d99
add persistence api to get concrete executions
andrewjdawson2016 Apr 3, 2020
c485efa
make more progress on scanner
andrewjdawson2016 Apr 3, 2020
66ff866
finish db scan command
andrewjdawson2016 Apr 3, 2020
f5a9148
add license header
andrewjdawson2016 Apr 3, 2020
0680282
finish db scan command
andrewjdawson2016 Apr 3, 2020
cedbbb6
fix small issues
andrewjdawson2016 Apr 3, 2020
dc29b3d
remove hostSelectionPolicy from cassandra cluster config as it is alr…
andrewjdawson2016 Apr 3, 2020
31f72dc
add rate limiter, make more options configurable
andrewjdawson2016 Apr 4, 2020
0e46f1c
Add information to progress report on if shards count not finish
andrewjdawson2016 Apr 4, 2020
47e16e6
make improvements to scan
andrewjdawson2016 Apr 4, 2020
d1a5e89
run make fmt and cleanup file writes
andrewjdawson2016 Apr 6, 2020
d169736
correct bug of resetting map in db scan and use deserialize batch ins…
andrewjdawson2016 Apr 6, 2020
0f20191
treat getting empty history as a corrupted workflow
andrewjdawson2016 Apr 6, 2020
8fa70b4
remove generated *.json files
andrewjdawson2016 Apr 6, 2020
603898e
correct cql connection policy
andrewjdawson2016 Apr 6, 2020
bac6227
remove json files
andrewjdawson2016 Apr 6, 2020
256f2da
Update db admin commands
andrewjdawson2016 Apr 6, 2020
62e36a8
run make fmt
andrewjdawson2016 Apr 7, 2020
5fc7bf3
Add logic to delete empty files
andrewjdawson2016 Apr 7, 2020
ca1ca30
remove scan files
andrewjdawson2016 Apr 7, 2020
f9ae380
add check for orphan concrete mutable state
andrewjdawson2016 Apr 7, 2020
eaa9ef0
change name for current execution corruption:
andrewjdawson2016 Apr 7, 2020
b54ffd8
fix nil ptr
andrewjdawson2016 Apr 7, 2020
0323216
add rps to progress report and take shard range
andrewjdawson2016 Apr 7, 2020
e4f6af2
add db rps to progress report
andrewjdawson2016 Apr 7, 2020
f06f0ea
respond to cr feedback
andrewjdawson2016 Apr 7, 2020
aa34538
Merge branch 'master' into dbAdmin
andrewjdawson2016 Apr 7, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Start db admin operation
  • Loading branch information
andrewjdawson2016 committed Apr 7, 2020
commit e365f7a6f1cb7f6bb559c2bb9c8ab66ffc01fa8f
58 changes: 58 additions & 0 deletions tools/cli/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -910,3 +910,61 @@ func newAdminDLQCommands() []cli.Command {
},
}
}

func newDBCommands() []cli.Command {
return []cli.Command{
{
Name: "scan",
Aliases: []string{"scan"},
Usage: "scan all concrete executions in database and detect corruptions",
Flags: []cli.Flag{
// for persistence connection
// TODO need to support other database: https://github.com/uber/cadence/issues/2777
cli.StringFlag{
Name: FlagDBAddress,
Usage: "persistence address(right now only cassandra is supported)",
},
cli.IntFlag{
Name: FlagDBPort,
Value: 9042,
Usage: "persistence port",
},
cli.StringFlag{
Name: FlagUsername,
Usage: "cassandra username",
},
cli.StringFlag{
Name: FlagPassword,
Usage: "cassandra password",
},
cli.StringFlag{
Name: FlagKeyspace,
Usage: "cassandra keyspace",
},
cli.BoolFlag{
Name: FlagEnableTLS,
Usage: "enable TLS over cassandra connection",
},
cli.StringFlag{
Name: FlagTLSCertPath,
Usage: "cassandra tls client cert path (tls must be enabled)",
},
cli.StringFlag{
Name: FlagTLSKeyPath,
Usage: "cassandra tls client key path (tls must be enabled)",
},
cli.StringFlag{
Name: FlagTLSCaPath,
Usage: "cassandra tls client ca path (tls must be enabled)",
},
cli.BoolFlag{
Name: FlagTLSEnableHostVerification,
Usage: "cassandra tls verify hostname and server cert (tls must be enabled)",
},
},
Action: func(c *cli.Context) {
AdminShowWorkflow(c)
},
},
}
}
6 changes: 6 additions & 0 deletions tools/cli/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,12 @@ func NewCliApp() *cli.App {
Usage: "Run admin operation on DLQ",
Subcommands: newAdminDLQCommands(),
},
{
Name: "db",
Aliases: []string{"db"},
Usage: "Run admin operations on database",
Subcommands: newDBCommands(),
},
},
},
{
Expand Down