Skip to content

Conversation

@tlrx
Copy link
Member

@tlrx tlrx commented Feb 8, 2018

Similarly to what has been done for s3 and azure, this pull request removes
the repository settings application_name and connect/read_timeout
in favour of settings at the client level.

It introduces a GoogleCloudStorageClientSettings
class (similar to S3ClientSettings) and a bunch of unit tests for that,
it aligns the documentation to be more coherent with the S3 one, it
documents the connect/read timeouts that were not documented at all
and also adds a new client setting that allows to define a custom endpoint.

@tlrx tlrx force-pushed the client-settings-for-repository-gcs branch 2 times, most recently from 4b2fc3c to 699cc7e Compare February 13, 2018 15:32
@clintongormley clintongormley added :Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs and removed :Plugin Repository GCS labels Feb 14, 2018
Similarly to what has been done for s3 and azure, this commit removes
the repository settings `application_name` and `connect/read_timeout`
in favor of client settings. It introduce a GoogleCloudStorageClientSettings
class (similar to S3ClientSettings) and a bunch of unit tests for that,
it aligns the documentation to be more coherent with the S3 one, it
documents the connect/read timeouts that were not documented at all and
also adds a new client setting that allows to define a custom endpoint.
@tlrx tlrx requested a review from rjernst February 15, 2018 08:17
@tlrx
Copy link
Member Author

tlrx commented Feb 15, 2018

@rjernst Would you like to review this please? I'd like to move forward on this, as exposing the endpoint setting will help to test the plugin using a fixture.

@tlrx tlrx force-pushed the client-settings-for-repository-gcs branch from 699cc7e to 5d1ff1d Compare February 15, 2018 08:18
@tlrx tlrx requested a review from ywelsch February 21, 2018 12:43
Copy link
Contributor

@ywelsch ywelsch left a comment

Choose a reason for hiding this comment

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

LGTM (some super minor nits)

// TEST[skip:we don't have gcs setup while testing this]

Some settings are sensitive and must be stored in the
{ref}/secure-settings.html[elasticsearch keystore]. This is the case of the service account file:
Copy link
Contributor

Choose a reason for hiding this comment

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

the case for the ...?

`endpoint`::

The Google Cloud Storage service endpoint to connect to. This will be automatically
figured out by the Google Cloud Storage client but can be specified explicitly.
Copy link
Contributor

Choose a reason for hiding this comment

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

automatically determined by the ...

==== Google Cloud Storage Repository plugin

* The repository settings `application_name`, `connect_timeout` and `read_timeout` have been removed and
must now be specified in the client settings instead.
Copy link
Contributor

Choose a reason for hiding this comment

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

link to the docs here?

}

private final Map<String, GoogleCredential> credentials;
private final Map<String, GoogleCloudStorageClientSettings> clientsSettings;
Copy link
Contributor

Choose a reason for hiding this comment

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

clientsSettings -> clientSettings?

Copy link
Member Author

Choose a reason for hiding this comment

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

There can be multiple client settings keyed by their name so I chose the plural form :)

The client used to connect to S3 has a number of settings available. Client setting names are of
the form `s3.client.CLIENT_NAME.SETTING_NAME` and specified inside `elasticsearch.yml`. The
default client name looked up by an s3 repository is called `default`, but can be customized
default client name looked up by a `s3` repository is called `default`, but can be customized
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe instead "The default client name used by the "s3" repository is called default ...

Copy link
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

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

LGTM


[source,sh]
----
bin/elasticsearch-keystore add gcs.client.default.credentials_file
Copy link
Member

Choose a reason for hiding this comment

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

The subcommand is add-file, not add.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch

[source,sh]
----
bin/elasticsearch-keystore add gcs.client.default.credentials_file
bin/elasticsearch-keystore add gcs.client.default.credentials_file
Copy link
Member

Choose a reason for hiding this comment

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

And this line seems to be duplicated?

@tlrx tlrx merged commit a6a1389 into elastic:master Feb 22, 2018
@tlrx
Copy link
Member Author

tlrx commented Feb 22, 2018

Thanks @ywelsch and @rjernst

tlrx added a commit that referenced this pull request Mar 9, 2018
Similarly to what has been done for s3 and azure, this commit removes
the repository settings `application_name` and `connect/read_timeout`
in favor of client settings. It introduce a GoogleCloudStorageClientSettings
class (similar to S3ClientSettings) and a bunch of unit tests for that,
it aligns the documentation to be more coherent with the S3 one, it
documents the connect/read timeouts that were not documented at all and
also adds a new client setting that allows to define a custom endpoint.
@tlrx tlrx added the v6.3.0 label Mar 9, 2018
@tlrx
Copy link
Member Author

tlrx commented Mar 9, 2018

This change has been backported to 6.x in 240aa34 along with a deprecation log and updated migration documentation.

sebasjm pushed a commit to sebasjm/elasticsearch that referenced this pull request Mar 10, 2018
Similarly to what has been done for s3 and azure, this commit removes
the repository settings `application_name` and `connect/read_timeout`
in favor of client settings. It introduce a GoogleCloudStorageClientSettings
class (similar to S3ClientSettings) and a bunch of unit tests for that,
it aligns the documentation to be more coherent with the S3 one, it
documents the connect/read timeouts that were not documented at all and
also adds a new client setting that allows to define a custom endpoint.
@tlrx tlrx deleted the client-settings-for-repository-gcs branch July 1, 2019 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants