Skip to content

Add last refresh times and unwritten changes state to RefreshStats #111220

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

limotova
Copy link
Contributor

@limotova limotova commented Jul 24, 2024

Adds several fields to RefreshStats, including the last external and
internal refresh times, and a flag indicating if the shard has unwritten
changes.

Fixes #110852

@elasticsearchmachine elasticsearchmachine added v8.16.0 needs:triage Requires assignment of a team area label external-contributor Pull request authored by a developer outside the Elasticsearch team labels Jul 24, 2024
/**
* Timestamp of the last refresh.
*/
public long getLastRefreshTime() {
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 decided to make these values timestamps rather than a duration (like timeSinceLastRefresh) because from what I could tell timestamps are more widely used in the stats, but also because it was proving it be very difficult to write solid tests when the stat grows with time.

/**
* Whether there are changes that need to be written to disk or not.
*/
public boolean getHasUnwrittenChanges() {
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 went back and forth between unwritten and unrefreshed and settled on unwritten, but I'm happy to change it to unrefreshed..!

@saikatsarkar056 saikatsarkar056 added the :Distributed Indexing/Engine Anything around managing Lucene and the Translog in an open shard. label Jul 31, 2024
@elasticsearchmachine elasticsearchmachine added Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. and removed needs:triage Requires assignment of a team area label labels Jul 31, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (Team:Distributed)

@elasticsearchmachine elasticsearchmachine added v9.1.0 Team:Distributed Indexing Meta label for Distributed Indexing team and removed v9.0.0 labels Jan 30, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-distributed-obsolete (Team:Distributed (Obsolete))

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-distributed-indexing (Team:Distributed Indexing)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed Indexing/Engine Anything around managing Lucene and the Translog in an open shard. external-contributor Pull request authored by a developer outside the Elasticsearch team Team:Distributed Indexing Meta label for Distributed Indexing team Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose last-refreshed time in shard/index stats
4 participants