-
Notifications
You must be signed in to change notification settings - Fork 817
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
Admin CLI: add describeHistoryHost #826
Admin CLI: add describeHistoryHost #826
Conversation
50: optional string address | ||
} | ||
|
||
struct DomainCache{ |
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.
It would be more precise to be named DomainCacheInfo or something else
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.
That sounds good to me.
tools/cli/adminCommands.go
Outdated
|
||
wid := c.String(FlagWorkflowID) | ||
sid := c.String(FlagShardID) | ||
addr := c.String(FlagAddress) |
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.
You need a new flag FlagHistoryAddress here to avoid collision of global frontend address and this specific history address.
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.
Yeah, that's a good point. I started with different flag but then found a similar one and tried to reuse it. But that won't work because of the conflict.
tools/cli/admin.go
Outdated
Name: FlagAddressWithAlias, | ||
Usage: "Host address(IP:PORT)", | ||
}, | ||
// We have to use string type here because the CLI framework will mix 0 and empty value |
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.
You could still use IntFlag here. To tell difference between 0 and empty, use c.IsSet().
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.
Sounds good.
tools/cli/adminCommands.go
Outdated
printFully := c.Bool(FlagPrintFullyDetail) | ||
|
||
if len(wid) <= 0 && len(sid) <= 0 && len(addr) <= 0 { | ||
ExitIfError(fmt.Errorf("at least one of them is required to provide to lookup host: workflowID, shardID and host address")) |
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.
Let's deprecated ExitIfError and use ErrorAndExit. The former one had a confusing STACK_TRACE thing and lack of color and human readable print.
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.
Sounds good.
@@ -49,3 +59,23 @@ struct DescribeWorkflowExecutionResponse{ | |||
40: optional string mutableStateInCache | |||
50: optional string mutableStateInDatabase | |||
} | |||
|
|||
//At least one of the parameters needs to be provided | |||
struct DescribeHistoryHostRequest { |
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.
Should we put the request and response struct to shared.thrift, to avoid redundancy?
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.
That sounds good to me.
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 after address 2 more small comments.
@@ -36,6 +36,16 @@ service AdminService { | |||
3: shared.EntityNotExistsError entityNotExistError, | |||
4: shared.AccessDeniedError accessDeniedError, | |||
) | |||
|
|||
/** |
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.
The indent looks not good.
service/history/handler.go
Outdated
status += "not stopped," | ||
} | ||
if h.controller.isStopping { | ||
status += "stopping," |
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.
The comma at the end of string looks not necessary, or is that on purpose?
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.
Not on purpose. I will remove it.
0f6242c
to
1d62387
Compare
Tested in local laptop: