Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,14 @@ private void startDownsampleTaskViaIlm(
var request = new UpdateSettingsRequest(sourceIndex).settings(
Settings.builder().put(LifecycleSettings.LIFECYCLE_NAME, POLICY_NAME)
);
// Updating index.lifecycle.name setting may fail due to the rolling restart itself,
// we need to attempt it in a assertBusy(...)
assertBusy(() -> {
try {
if (indexExists(sourceIndex) == false) {
Copy link
Contributor

@salvatore-campagna salvatore-campagna Sep 4, 2023

Choose a reason for hiding this comment

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

If I understand correctly this might happen in case there is a background downsample task running that failed for some reason, has been retried, and before we get here, the task completes right?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes. For example the request to update index settings fails to return because the node got shutdown, but the index settings were updated. The downsampling can be kicked off. When retrying the source index could not longer exist.

logger.info("The source index [{}] no longer exists, downsampling likely completed", sourceIndex);
return;
}
client().admin().indices().updateSettings(request).actionGet(TimeValue.timeValueSeconds(10));
} catch (Exception e) {
logger.warn(() -> format("encountered failure while updating [%s] index's ilm policy", sourceIndex), e);
Expand Down