Skip to content

Batch close-indices cluster state updates#84259

Merged
joegallo merged 17 commits intoelastic:masterfrom
joegallo:batch-add-blocks-and-close
Feb 23, 2022
Merged

Batch close-indices cluster state updates#84259
joegallo merged 17 commits intoelastic:masterfrom
joegallo:batch-add-blocks-and-close

Conversation

@joegallo
Copy link
Copy Markdown
Contributor

@joegallo joegallo commented Feb 23, 2022

Related to #81627 and #83432, followup to #83760.

@joegallo joegallo added >enhancement :Data Management/Indices APIs DO NOT USE. Use ":Distributed/Indices APIs" or ":StorageEngine/Templates" instead. v8.2.0 labels Feb 23, 2022
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Hi @joegallo, I've created a changelog YAML for you.

Copy link
Copy Markdown
Member

@DaveCTurner DaveCTurner left a comment

Choose a reason for hiding this comment

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

Looks good, I left a few nits but seems structurally sound to me.

this.indicesService = indicesService;
this.shardLimitValidator = shardLimitValidator;
}
private class OpenIndicesExecutor implements ClusterStateTaskExecutor<OpenIndicesTask> {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Slight preference to keep this (and other executors) as static classes that hold onto the services they need directly.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ehhhh, this is a bit of a pain -- private class WaitForClosedBlocksApplied / private class WaitForBlocksApplied, and the former is invoked by AddBlocksToCloseExecutor, so I'd have to walk those two back, too.

I'm really with you on disliking (non-static) inner classes, they feel a bit too 'more magic' for me, but in this case they're all private anyway, and the juggling of the fields across them all just seems like noise.

That said, this isn't 'no', it's just 'ehhh, this is ever so slightly harder than you might have thought' -- feel free to say something like "yeah, that's cool, please make the change anyway" and I will happily do it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

My preference is only slight, I'll defer to your judgement.

Copy link
Copy Markdown
Member

@DaveCTurner DaveCTurner left a comment

Choose a reason for hiding this comment

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

Nits

Since we're just building a list with the returned collection anyway,
we might as well internalize that since this is the only production
invocation anyway.

Changed finalizeBlock, too, for parity, although that doesn't have the
full benefit here just yet because it hasn't been task-ified.
Copy link
Copy Markdown
Member

@DaveCTurner DaveCTurner left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Contributor

@original-brownbear original-brownbear left a comment

Choose a reason for hiding this comment

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

LGTM (nits really can be ignored, just had to let them out :))

@joegallo joegallo marked this pull request as ready for review February 23, 2022 21:07
@elasticmachine elasticmachine added the Team:Data Management (obsolete) DO NOT USE. This team no longer exists. label Feb 23, 2022
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Data Management/Indices APIs DO NOT USE. Use ":Distributed/Indices APIs" or ":StorageEngine/Templates" instead. >enhancement Team:Data Management (obsolete) DO NOT USE. This team no longer exists. v8.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants