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

Fix expiration time in async search response #55435

Merged
merged 7 commits into from
Apr 21, 2020

Conversation

jimczi
Copy link
Contributor

@jimczi jimczi commented Apr 19, 2020

This change ensures that we return the latest expiration time when retrieving the response from the index.
This commit also fixes a bug that stops the garbage collection of saved responses if the async search index is deleted.

This change ensures that we return the latest expiration time
when retrieving the response from the index.
@jimczi jimczi added >bug :Search/Search Search-related issues that do not fall into other categories v8.0.0 v7.7.1 labels Apr 19, 2020
@jimczi jimczi requested a review from javanna April 19, 2020 21:50
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (:Search/Search)

Copy link
Member

@javanna javanna left a comment

Choose a reason for hiding this comment

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

thanks for fixing, I left a bunch of comments, mainly questions.


/**
* A service that runs a periodic cleanup over the async-search index.
*/
class AsyncSearchMaintenanceService implements Releasable, ClusterStateListener {
private static final Logger logger = LogManager.getLogger(AsyncSearchMaintenanceService.class);

public static final Setting<TimeValue> ASYNC_SEARCH_CLEANUP_INTERVAL_SETTING =
Setting.timeSetting("async_search.index_cleanup_interval", TimeValue.timeValueHours(1), Setting.Property.NodeScope);
Copy link
Member

Choose a reason for hiding this comment

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

do we plan on using this new setting only in our tests? Or can it be useful for users too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe for debug but I don't think it's useful for users, only for tests at the moment.

Copy link
Member

Choose a reason for hiding this comment

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

There is no way to somehow make this "private" or for use only in our tests? I worry mostly about naming, and the fact that users may end up using it although we would not want them to.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The default value is quite large (1h) so maybe there's some value to change it. I am not sure, I can make it private but that would work only in fantasy integration tests (single vm) so this will come back. I was expecting that the lack of documentation would make this setting an expert thing that users would never heard from ?

Copy link
Member

Choose a reason for hiding this comment

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

yea I see, can you add a comment that this is intentionally undocumented?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I pushed 09afaca

@jimczi
Copy link
Contributor Author

jimczi commented Apr 20, 2020

Thanks for looking @javanna , I pushed some changes to address your comments.

Copy link
Member

@javanna javanna left a comment

Choose a reason for hiding this comment

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

LGTM

@jimczi
Copy link
Contributor Author

jimczi commented Apr 21, 2020

@elasticmachine run elasticsearch-ci/1

@jimczi jimczi merged commit 77a1afc into elastic:master Apr 21, 2020
@jimczi jimczi deleted the async_search_expiration_time branch April 21, 2020 11:34
jimczi added a commit that referenced this pull request Apr 21, 2020
This change ensures that we return the latest expiration time
when retrieving the response from the index.
This commit also fixes a bug that stops the garbage collection of saved responses if the async search index is deleted.
jimczi added a commit that referenced this pull request Apr 21, 2020
This change ensures that we return the latest expiration time
when retrieving the response from the index.
This commit also fixes a bug that stops the garbage collection of saved responses if the async search index is deleted.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Search/Search Search-related issues that do not fall into other categories v7.7.1 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants