-
Notifications
You must be signed in to change notification settings - Fork 15
add advertised endpoint to cluster / active fo #192
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
Conversation
ewoutp
left a comment
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.
Couple of minor issues that needs to be fixed.
Documentation of the new option also need to be added to docs/...
CHANGELOG.md
Outdated
| @@ -1,5 +1,7 @@ | |||
| # Changed from version 0.12.0 to master | |||
|
|
|||
| - Added advertised endpoint to coordinators and active fo | |||
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.
active fo ??
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.
active failover?
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.
"Added advertised endpoint to cluster & activefailover deployments."
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.
fixed
main.go
Outdated
| f.IntVar(&logRotateFilesToKeep, "log.rotate-files-to-keep", defaultLogRotateFilesToKeep, "Number of files to keep when rotating log files") | ||
| f.DurationVar(&logRotateInterval, "log.rotate-interval", defaultLogRotateInterval, "Time between log rotations (0 disables log rotation)") | ||
|
|
||
| f.StringVar(&advertisedEndpoint, "cluster.advertised-endpoint", "", "An external endpoint for this cluster") |
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 sure about "this cluster" since it is the coordinator/single.
Also we should talk about the format here, e.g. by adding an example.
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.
Of course, but it's the cluster's endpoint, right? You mentioned yourself the load balancer scenario.
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 is correct, I just think the comment should be more elaborate.
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.
fixed
service/arangod_config_builder.go
Outdated
| ) | ||
| case ServerTypeResilientSingle: | ||
| options = append(options, | ||
| optionPair{"--cluster.my-advertised-endpoint", config.AdvertisedEndpoint}, |
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.
Remove this
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.
oops.
service/arangod_config_builder.go
Outdated
| optionPair{"--foxx.queues", "true"}, | ||
| optionPair{"--server.statistics", "true"}, | ||
| ) | ||
| if config.AdvertisedEndpoint != "" { |
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'll probably move this block out of the switch and wrap it in an if serverType == ServerTypeCoordinator || serverType == ServerTypeResilientSingle { ... }
This avoids code duplication.
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.
Sure
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.
fixed
| ArangodPath: arangodPath, | ||
| ArangoSyncPath: arangoSyncPath, | ||
| ArangodJSPath: arangodJSPath, | ||
| AdvertisedEndpoint: advertisedEndpoint, |
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.
IMO the advertised endpoint should be checked (when non-empty) to make sure it is a valid format.
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.
Again, also here we had decided to not do any sanity checks. It it does not suffice the endpoint specification, the affected services will complain. Effectively like wrong passthrough options
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 so sure on the "no sanity checks". If we decided to that, it sounds like a bad decision.
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.
Now test was added. Problem solved.
| ArangodPath: arangodPath, | ||
| ArangoSyncPath: arangoSyncPath, | ||
| ArangodJSPath: arangodJSPath, | ||
| AdvertisedEndpoint: advertisedEndpoint, |
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.
Secondly I suggest to allow the use of "http" & "https" schemes in here and automatically transform them to "tcp" & "ssl"
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.
We had that discussion and decided to the contrary. It had to suffice the enpoint scheme. Keep in mind that this was supposed to not be interpreted in any way and match the endpoint specification and was the reason we decided to not call it advertised-address. No sanity checks no nothing.
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 strongly disagree on this. The starter is supposed to make life easier and having think about "tcp://" or "ssl://" where everyone knows about "http://" and "https://" does not help.
Also we don't have to check anything except replace an "http://" prefix with "tcp://" (and https...)
main.go
Outdated
| "context" | ||
| "fmt" | ||
| "io/ioutil" | ||
| "net/url" |
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 formatted
service/arangod_config_builder.go
Outdated
|
|
||
| // FixupEndpointURLScheme changes endpoint URL schemes used by arangod to ones used by arangodb. | ||
| // E.g. "http://localhost:8529" -> "tcp://localhost:8529" | ||
| func FixupEndpointURLScheme(u string) string { |
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.
This function does not have to be exported.
service/arangod_config_builder.go
Outdated
| ) | ||
| ) | ||
|
|
||
| // FixupEndpointURLScheme changes endpoint URL schemes used by arangod to ones used by arangodb. |
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.
'FixupEndpointURLScheme changes endpoint URL schemes used by arangod to ones used by arangodb.' -> 'FixupEndpointURLScheme changes endpoint URL schemes used by Starter to ones used by arangod.'
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.
Fixed
ewoutp
left a comment
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
No description provided.