-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Introduce node mappings stats #89807
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
Introduce node mappings stats #89807
Conversation
|
Documentation preview: |
d4ba2f3 to
8375f37
Compare
b909f1e to
f4cf6c9
Compare
|
Pinging @elastic/es-distributed (Team:Distributed) |
|
Pinging @elastic/es-data-management (Team:Data Management) |
|
Hi @kingherc, I've created a changelog YAML for you. |
|
@original-brownbear I'm removing you from reviewers for now, and converting this back to draft, since we want more stuff on the sub-PR #89798. Once that is done, I'll rebase this and re-invite you to review. |
77cdd79 to
c60288e
Compare
c60288e to
c133985
Compare
So that they are visible in NodeIndicesStats only at the node and index (but not shard) levels. Also visible in the _cat/nodes table. Relates to issue elastic#86639
And make an exact count yaml REST test
And FieldMapperStats to NodeMappingStats
c133985 to
2821d2c
Compare
|
Hi @original-brownbear , I rebased on master and did some fixes. Feel free to review now, thanks! |
And use in checkFieldLimit
DaveCTurner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mainly just looked at the docs changes and left some suggestions.
| per index held by each data node. In a running cluster, you can also consult the | ||
| <<cluster-nodes-stats,Nodes stats API>>'s `mappings` indices statistic, which | ||
| reports the number of field mappings and an estimation of their heap overhead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should consider rephrasing this whole section in terms of these stats now that they're available. We can however do that in a followup - it's the third item on the list for #86639.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, feel free to gather ideas already here if you'd like. cc @original-brownbear
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with a follow-up, linking from here is fine by me for now.
Yes feel free to also look at the other changes as well if you'd like, otherwise I consider @original-brownbear as the main reviewer. |
|
Ping @original-brownbear for a review, in case we can make this before FF of 8.5.0. |
original-brownbear
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few initial points, I'll give it another pass a little later. Looks good overall though thanks!
| per index held by each data node. In a running cluster, you can also consult the | ||
| <<cluster-nodes-stats,Nodes stats API>>'s `mappings` indices statistic, which | ||
| reports the number of field mappings and an estimation of their heap overhead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with a follow-up, linking from here is fine by me for now.
rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/nodes.stats/11_indices_metrics.yml
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/indices/IndicesService.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/indices/IndicesService.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/indices/NodeIndicesStats.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/indices/NodeIndicesStats.java
Outdated
Show resolved
Hide resolved
original-brownbear
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes @kingherc I added a few more questions about the code.
server/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStats.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStats.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStats.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStats.java
Outdated
Show resolved
Hide resolved
|
Hi @original-brownbear , I fixed the last comments, feel free to give it another review! thanks! |
original-brownbear
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Iraklis, this looks good now. Just one spot that I found where we could massively simplify this for now when reading over it again and some small stuff.
server/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStats.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStats.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStats.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStats.java
Outdated
Show resolved
Hide resolved
|
@original-brownbear , fixed your comments. Feel free to check the last commit, thanks! |
original-brownbear
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just some minor NITs that don't require another round of reviewing.
| if (stats.getNodeMappings() != null) { | ||
| if (nodeMappings == null) { | ||
| nodeMappings = new NodeMappingStats(); | ||
| nodeMappings.add(stats.getNodeMappings()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we just do what we do for shard stats above and go with:
if (nodeMappings == null) {
nodeMappings = stats.getNodeMappings();
} else {
nodeMappings.add(stats.getNodeMappings());
}?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe shard stats is doing it very differently than the code above it, which actually creates a new object rather than assigning the reference of the added object (like what shard stats code is doing). So I decided to follow the above code, which seems better/safer to me. Feel free to tell me if you disagree and I can make it like shard stats
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hah yea we have both versions. It doesn't really matter I guess, fine by me to go with the safe version here.
In CommonStats so that they are visible in NodeIndicesStats only at the node and index (but not shard) levels. Also visible in the _cat/nodes table.
Relates to issue #86639