-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Register IngestGeoIpMetadata as a NamedXContent #123079
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
Register IngestGeoIpMetadata as a NamedXContent #123079
Conversation
This makes this class more like SnapshotLifecycleMetadata and IndexLifecycleMetadata, but I don't think this is load bearing code. The previous String literal version was more like EnrichMetadata, so there's prior art for that, but it feels more like an odd duck to me.
|
Hi @joegallo, I've created a changelog YAML for you. |
|
In terms of tests, I would expect Also when I ran that task I saw that it only attempts an upgrade from v8.19.0. If it's trying to test BwC then it should be picking up all compatible versions right? And it should definitely be doing a full-cluster-restart without an upgrade too. |
|
By "pick this up" I mean I would expect some assertion somewhere to trip, if we wrote out some elasticsearch/server/src/main/java/org/elasticsearch/cluster/metadata/Metadata.java Lines 2684 to 2686 in 2ee7ca4
|
|
FTR we don't hit that lenient code in diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/Metadata.java b/server/src/main/java/org/elasticsearch/cluster/metadata/Metadata.java
index 35e853cdd55a..bc7e08fd76eb 100644
--- a/server/src/main/java/org/elasticsearch/cluster/metadata/Metadata.java
+++ b/server/src/main/java/org/elasticsearch/cluster/metadata/Metadata.java
@@ -2682,6 +2682,7 @@ public class Metadata implements Iterable<IndexMetadata>, Diffable<Metadata>, Ch
Custom custom = parser.namedObject(Custom.class, currentFieldName, null);
builder.putCustom(custom.getWriteableName(), custom);
} catch (NamedObjectNotFoundException ex) {
+ assert false : ex;
logger.warn("Skipping unknown custom object with type {}", currentFieldName);
parser.skipChildren();
}So there's at least three test problems here:
|
|
I happen to know the history here -- I wrote the I'll rename the test to better reflect its true purpose, and write a new I'll add the assert you mentioned, too. I'd already found that line of code and had a big loop of printlns there to figure out why it was claiming that there wasn't any way to handle However, I think we should go one more: I'm curious what it would look like to add an assert that makes sure that a cluster state that we write to disk is deserializable from disk (immediately after writing). This would have failed on the code prior to this PR, and it wouldn't have required a test that we don't have, and that, indeed, I didn't realize I had to write. |
We already have this, see |
|
Pinging @elastic/es-data-management (Team:Data Management) |
💔 Backport failed
You can use sqren/backport to manually backport by running |
|
Manual backports are up. |
If you upgrade Elasticsearch via a full cluster restart, then the
DatabaseConfigurationMetadataentries from the cluster state get cleared out. This is easiest to reproduce by putting a single node cluster through an upgrade OR a restart. In either of those cases, we restore the cluster state by reading the x-content from disk (rather than serializing it over the network), so we're exercising an entirely different path than in the case of the ordinary operations of a cluster, or the case of rolling (node-by-node) upgrades.I renamed the existing
full-cluster-restarttest togeoip-reindexedto better capture the purpose of the test, and I added a newfull-cluster-restarttest that would have caught wrong behavior here (note: it really doesn't do anything more than that, though, but I'd argue that's enough for right now).As a matter of inside baseball, the previous paragraph means that you'd almost certainly be better off reviewing this PR commit by commit rather than reading the overall diff of the PR. But do as you'd like.