Skip to content

Conversation

@kvahed
Copy link
Contributor

@kvahed kvahed commented Aug 7, 2018

No description provided.

@kvahed kvahed requested review from ewoutp and neunhoef August 7, 2018 13:55
Copy link
Contributor

@ewoutp ewoutp left a 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
Copy link
Contributor

Choose a reason for hiding this comment

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

active fo ??

Copy link
Contributor Author

Choose a reason for hiding this comment

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

active failover?

Copy link
Contributor

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."

Copy link
Contributor

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")
Copy link
Contributor

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.

Copy link
Contributor Author

@kvahed kvahed Aug 9, 2018

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.

Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

fixed

)
case ServerTypeResilientSingle:
options = append(options,
optionPair{"--cluster.my-advertised-endpoint", config.AdvertisedEndpoint},
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove 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.

oops.

optionPair{"--foxx.queues", "true"},
optionPair{"--server.statistics", "true"},
)
if config.AdvertisedEndpoint != "" {
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure

Copy link
Contributor

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,
Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor

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.

Copy link
Contributor

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,
Copy link
Contributor

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"

Copy link
Contributor Author

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.

Copy link
Contributor

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"
Copy link
Contributor

Choose a reason for hiding this comment

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

Not formatted


// 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 {
Copy link
Contributor

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.

)
)

// FixupEndpointURLScheme changes endpoint URL schemes used by arangod to ones used by arangodb.
Copy link
Contributor

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.'

Copy link
Contributor

Choose a reason for hiding this comment

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

Fixed

Copy link
Contributor

@ewoutp ewoutp left a comment

Choose a reason for hiding this comment

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

LGTM

@neunhoef neunhoef merged commit 194a96e into master Sep 25, 2018
@neunhoef neunhoef deleted the feature/add-advertised-endpoint branch September 25, 2018 09:26
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.

4 participants