Skip to content

Conversation

nik9000
Copy link
Member

@nik9000 nik9000 commented Oct 2, 2024

This removes the undocumented META FUNCTIONS command that emits descriptions for all functions. This shouldn't be used because we never told anyone about it. I'd have preferred if we'd have explicitly documented it as no public or if we'd have left it snapshot-only. But sometimes you make a mistake. I'm hopeful no one is relying on it. It was never reliable and not public.....

This removes the undocumented `META FUNCTIONS` command that emits
descriptions for all functions. This shouldn't be used because we never
told anyone about it. I'd have preferred if we'd have explicitly
documented it as no public or if we'd have left it snapshot-only. But
sometimes you make a mistake. I'm hopeful no one is relying on it. It
was never reliable and not public.....
@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Oct 2, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

@elasticsearchmachine
Copy link
Collaborator

Hi @nik9000, I've created a changelog YAML for you. Note that since this PR is labelled >deprecation, you need to update the changelog YAML to fill out the extended information sections.

@elasticsearchmachine
Copy link
Collaborator

Hi @nik9000, I've updated the changelog YAML for you. Note that since this PR is labelled >breaking, you need to update the changelog YAML to fill out the extended information sections.

Copy link
Contributor

@alex-spies alex-spies 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 Nik!

KEEP(Keep.class::isInstance),
RENAME(Rename.class::isInstance),
META(MetaFunctions.class::isInstance);
META(p -> false);
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's add a comment why this exists and why it shouldn't be removed.

Actually, can this be removed? I think @astefan or @luigidellaquila know more about feature metrics and could know if old metrics need to be kept around.

Copy link
Member Author

Choose a reason for hiding this comment

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

Let me dig more. I had thought removing it would be dangerous for serialization of the metric. I'll look!

Copy link
Member Author

Choose a reason for hiding this comment

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

Looking more, I'm not sure why we have the note about the ordering here. It looks like no instances of this class escape a node. We use strings for serializing it. So maybe we're safe here. Can I just delete this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Metrics are not serialized between nodes, and the Stats API relies on the metric name, not on the enum ordinal (that is only used during the metric collection phase, to populate a bitset).
I think it's safe to remove, but please wait for @astefan

Copy link
Contributor

@ivancea ivancea 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
Contributor

@luigidellaquila luigidellaquila 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 Nik.
Just wait for @astefan to confirm that the enum entry can be dropped

KEEP(Keep.class::isInstance),
RENAME(Rename.class::isInstance),
META(MetaFunctions.class::isInstance);
META(p -> false);
Copy link
Contributor

Choose a reason for hiding this comment

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

Metrics are not serialized between nodes, and the Stats API relies on the metric name, not on the enum ordinal (that is only used during the metric collection phase, to populate a bitset).
I think it's safe to remove, but please wait for @astefan

@nik9000 nik9000 requested a review from a team as a code owner October 3, 2024 14:58
@nik9000
Copy link
Member Author

nik9000 commented Oct 3, 2024

I pushed a patch that removes it. The tests seemed ok locally. Absolutely will wait on feedback though. can revert that patch easily enouhg.

@nik9000
Copy link
Member Author

nik9000 commented Oct 4, 2024

@astefan, do you think it's ok to remove the META constant above? If so, I think I should remove the comment about adding things in order because I don't believe it makes a difference here.

@mark-vieira mark-vieira added auto-backport Automatically create backport pull requests when merged and removed auto-backport-and-merge labels Oct 4, 2024
@nik9000 nik9000 enabled auto-merge (squash) October 7, 2024 18:21
Copy link
Contributor

@astefan astefan left a comment

Choose a reason for hiding this comment

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

I think the changes are ok, given that the CI is happy. @luigidellaquila mentioned that the name of the enum is used and he's correct, but there is serialization I think. The serializations is for the name of the metrics in EsqlUsageTransportAction.masterOperation where counters from all nodes are merged together, each Counter instance being a Map<String,Long>. And the individual Counter instances are built in Metrics.counters().

The only additional step I did when adding all this telemetry fun was to update the mappings of the cluster that holds all this data. That repo where the mappings are held and indices created is a blackbox to me and I have no idea what is the impact of removing one of those counters. I am only assuming that the documents that reach those indices will not have a value for meta/show anymore, which should be a problem I guess?

Copy link
Member

@costin costin 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
Contributor

@bpintea bpintea left a comment

Choose a reason for hiding this comment

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

Lgtm

"Cluster and node setting",
"Command line tool",
"CRUD",
"ES|QL",
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

protected void shouldSkipTest(String testName) throws IOException {
super.shouldSkipTest(testName);
assumeTrue("Test " + testName + " is skipped on " + bwcVersion, isEnabled(testName, instructions, bwcVersion));
assumeFalse(
Copy link
Contributor

Choose a reason for hiding this comment

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

Should the similar be removed from MultiClusterSpecIT class as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

@bpintea bpintea left a comment

Choose a reason for hiding this comment

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

Lgtm

@nik9000
Copy link
Member Author

nik9000 commented Oct 8, 2024

I think the changes are ok, given that the CI is happy. @luigidellaquila mentioned that the name of the enum is used and he's correct, but there is serialization I think. The serializations is for the name of the metrics in EsqlUsageTransportAction.masterOperation where counters from all nodes are merged together, each Counter instance being a Map<String,Long>. And the individual Counter instances are built in Metrics.counters().

That looks to be safe because it's done by name. So ok! We're safe to zap this. And the comment.

The only additional step I did when adding all this telemetry fun was to update the mappings of the cluster that holds all this data. That repo where the mappings are held and indices created is a blackbox to me and I have no idea what is the impact of removing one of those counters. I am only assuming that the documents that reach those indices will not have a value for meta/show anymore, which should be a problem I guess?

Not sending that should be fine. The field will just be missing/null. That's ok. Probably should keep it in the mapping over there too to handle older cluster versions.

@nik9000 nik9000 merged commit d3fa42c into elastic:main Oct 8, 2024
16 checks passed
nik9000 added a commit to nik9000/elasticsearch that referenced this pull request Oct 8, 2024
This removes the undocumented `META FUNCTIONS` command that emits
descriptions for all functions. This shouldn't be used because we never
told anyone about it. I'd have preferred if we'd have explicitly
documented it as no public or if we'd have left it snapshot-only. But
sometimes you make a mistake. I'm hopeful no one is relying on it. It
was never reliable and not public.....
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.x

elasticsearchmachine pushed a commit that referenced this pull request Oct 9, 2024
This removes the undocumented `META FUNCTIONS` command that emits
descriptions for all functions. This shouldn't be used because we never
told anyone about it. I'd have preferred if we'd have explicitly
documented it as no public or if we'd have left it snapshot-only. But
sometimes you make a mistake. I'm hopeful no one is relying on it. It
was never reliable and not public.....
matthewabbott pushed a commit to matthewabbott/elasticsearch that referenced this pull request Oct 10, 2024
This removes the undocumented `META FUNCTIONS` command that emits
descriptions for all functions. This shouldn't be used because we never
told anyone about it. I'd have preferred if we'd have explicitly
documented it as no public or if we'd have left it snapshot-only. But
sometimes you make a mistake. I'm hopeful no one is relying on it. It
was never reliable and not public.....
davidkyle pushed a commit to davidkyle/elasticsearch that referenced this pull request Oct 13, 2024
This removes the undocumented `META FUNCTIONS` command that emits
descriptions for all functions. This shouldn't be used because we never
told anyone about it. I'd have preferred if we'd have explicitly
documented it as no public or if we'd have left it snapshot-only. But
sometimes you make a mistake. I'm hopeful no one is relying on it. It
was never reliable and not public.....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/ES|QL AKA ESQL auto-backport Automatically create backport pull requests when merged >breaking Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v8.16.0 v9.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants