Skip to content

Conversation

@howardhuanghua
Copy link
Contributor

@howardhuanghua howardhuanghua commented Nov 8, 2020

Currently translog's earliest_last_modified_age field is always 0 in _nodes/stats response.

GET _nodes/stats?pretty
Response:
....
 "translog" : {
      "operations" : 87590,
      "size_in_bytes" : 181674457,
      "uncommitted_operations" : 87590,
      "uncommitted_size_in_bytes" : 181674457,
      "earliest_last_modified_age" : 0
    },
....

@matriv matriv added the :Distributed Indexing/Engine Anything around managing Lucene and the Translog in an open shard. label Nov 25, 2020
@elasticmachine elasticmachine added the Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. label Nov 25, 2020
@elasticmachine
Copy link
Collaborator

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

Copy link
Member

@dnhatn dnhatn left a comment

Choose a reason for hiding this comment

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

Thanks @howardhuanghua. I prefer fixing the issue when adding a translog stats instead.

@howardhuanghua
Copy link
Contributor Author

Thanks @dnhatn , you mean add a extra check to this.earliestLastModifiedAge, if it's 0L then set this.earliestLastModifiedAge = translogStats.earliestLastModifiedAge directly? Why would we just give a max long initial value for this.earliestLastModifiedAge? It seems much more simple.

@dnhatn
Copy link
Member

dnhatn commented Nov 25, 2020

Yes, but 0L is more appropriate than Long.MAX_VALUE for the timestamp of an empty translog.

@howardhuanghua
Copy link
Contributor Author

Hi @dnhatn, I have updated the change, please help to review again, thanks.

Copy link
Member

@dnhatn dnhatn left a comment

Choose a reason for hiding this comment

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

Thanks @howardhuanghua. I left a small comment.

this.uncommittedSizeInBytes += translogStats.uncommittedSizeInBytes;
this.earliestLastModifiedAge =
Math.min(this.earliestLastModifiedAge, translogStats.earliestLastModifiedAge);
if (this.earliestLastModifiedAge < 1) {
Copy link
Member

Choose a reason for hiding this comment

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

Let's use this.earliestLastModifiedAge == 0.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated, thanks.

@dnhatn
Copy link
Member

dnhatn commented Nov 26, 2020

@elasticmachine ok to test

Copy link
Member

@dnhatn dnhatn left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @howardhuanghua.

@dnhatn dnhatn merged commit 7f4ead9 into elastic:master Nov 26, 2020
dnhatn pushed a commit that referenced this pull request Nov 30, 2020
Currently translog's `earliest_last_modified_age` field is always 0 in `_nodes/stats` response.
dnhatn pushed a commit that referenced this pull request Nov 30, 2020
Currently translog's `earliest_last_modified_age` field is always 0 in `_nodes/stats` response.
dnhatn pushed a commit that referenced this pull request Nov 30, 2020
Currently translog's `earliest_last_modified_age` field is always 0 in `_nodes/stats` response.
@jakelandis jakelandis removed the v8.0.0 label Jul 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>bug :Distributed Indexing/Engine Anything around managing Lucene and the Translog in an open shard. Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. v6.1.5 v7.10.2 v7.11.0 v8.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants