-
Notifications
You must be signed in to change notification settings - Fork 3
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
Refactor indices aliases #2
Refactor indices aliases #2
Conversation
* Reorganizes the 8.0.0 and 8.1.0 breaking changes and deprecations into component-based categories. * Adds an ESS icon to cluster settings on the ESS user settings allowlist. * Adds tips for sections that aren't relevant to Cloud users. * Updates the labels for some items to provide better context. Co-authored-by: debadair <debadair@elastic.co>
…80696) We currently throw a message that always refers to the `_parent` field, even though it could be throw from any metadata field, and indeed the `_parent` field hasn't existed for several versions now.
Includes command line tool deprecations in the notable changes tag.
getIndices() and getAliases() go through indices() and aliases(), so do that here, too.
Makes several changes to consolidate snapshot and backup-related docs. Highlights: * Adds info about supported ESS snapshot repository types * Adds docs for Kibana's Snapshot and Restore feature * Combines tutorial pages related to taking and managing snapshots * Consolidates explanations of the snapshot process * Incorporates SLM into the snapshot tutorial * Removes duplicate "back up a cluster" pages
Update the notes in TESTING.asciidoc about how to build a distribution of Elasticsearch.
public ImmutableOpenMap<String, IndexTemplateMetadata> templates() { | ||
return this.templates; | ||
} | ||
|
||
public ImmutableOpenMap<String, IndexTemplateMetadata> getTemplates() { | ||
return this.templates; | ||
return templates(); |
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.
unrelated change?
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.
Not entirely unrelated, see 7f25f49.
previousIndicesLookup = null; | ||
|
||
List<Index> indices = new ArrayList<>(aliases.getOrDefault(alias, List.of())); | ||
indices.remove(index); // TODO what if it wasn't in the list already? |
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.
maybe:
if (indices.remove(index) == false) {
return this;
}
Which would make this a no-op.
previousIndicesLookup = null; | ||
|
||
List<Index> indices = new ArrayList<>(aliases.getOrDefault(alias, List.of())); | ||
indices.add(index); // TODO what if it's a duplicate? maybe use a Set<Index> instead? |
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 it easier if we make we change the aliases map to contain a Set instead of if List.
and also maybe:
if (indices.add(index) == false) {
return this;
}
to make this a no-op in case .
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'll make the List<Index>
--> Set<Index>
change throughout, and let's see what that gets us.
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.
Oh, actually, I just remembered -- https://github.com/elastic/elasticsearch/blob/fed20aa74b48b2220870c782027a69de305bf56c/server/src/main/java/org/elasticsearch/cluster/metadata/MetadataCreateIndexService.java#L1147-L1150 makes me think there's existing semantics around the order of the aliases for an index, might we want to preserve something that like here? That is, is there value in having List semantics rather than Set semantics or no?
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 don't think that is the case, once an index and its aliases are created.
.blocks(ClusterBlocks.builder().addBlocks(idxMetadata)) | ||
.build(); | ||
|
||
ClusterState after = service.deleteIndices(before, Set.of(before.metadata().getIndices().get(index).getIndex())); |
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.
maybe check that that before the delete call an alias entry does exist?
@@ -124,6 +124,13 @@ public ClusterState deleteIndices(ClusterState currentState, Set<Index> indices) | |||
metadataBuilder.put(parent.removeBackingIndex(index)); | |||
} | |||
} | |||
// delete associated aliases from the cluster state |
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.
Maybe inline this into Metadata.Builder#remove(...)
method? If an IndexMetadata has aliases then we always need to invoke the remobeAlias()
method (and we don't need to check whether aliases have changed).
…c#100592) * Don't print synthetic source in mapping for bwc tests * Move comment. * Don't print synthetic source in mapping for bwc tests #2 * Don't print synthetic source in mapping for bwc tests #2 * Revert "Don't print synthetic source in mapping for bwc tests #2" This reverts commit 034262c. * Revert "Don't print synthetic source in mapping for bwc tests #2" This reverts commit 44e8156. * Revert "Don't print synthetic source in mapping for bwc tests (elastic#100572)" This reverts commit 9322ab9. * Exclude synthetic source test from mixedClusterTests * Update comment.
….10 (elastic#100805) * Don't print synthetic source in mapping for bwc tests * Move comment. * Don't print synthetic source in mapping for bwc tests #2 * Don't print synthetic source in mapping for bwc tests #2 * Revert "Don't print synthetic source in mapping for bwc tests #2" This reverts commit 034262c. * Revert "Don't print synthetic source in mapping for bwc tests #2" This reverts commit 44e8156. * Revert "Don't print synthetic source in mapping for bwc tests (elastic#100572)" This reverts commit 9322ab9. * Exclude synthetic source test from mixedClusterTests * Update comment. * Mute all tsdb tests in mixedClusterTests This is an interim step to stop sporadic test failures, while we try to fix version skip for mixed cluster tests. * Remove old exclusion * Add aggregations too * Mute tests for versions between 8.7-8.10 * Remove mute
* Don't print synthetic source in mapping for bwc tests * Move comment. * Don't print synthetic source in mapping for bwc tests #2 * Don't print synthetic source in mapping for bwc tests #2 * Revert "Don't print synthetic source in mapping for bwc tests #2" This reverts commit 034262c. * Revert "Don't print synthetic source in mapping for bwc tests #2" This reverts commit 44e8156. * Revert "Don't print synthetic source in mapping for bwc tests (elastic#100572)" This reverts commit 9322ab9. * Exclude synthetic source test from mixedClusterTests * Update comment. * Mute all tsdb tests in mixedClusterTests This is an interim step to stop sporadic test failures, while we try to fix version skip for mixed cluster tests. * Remove old exclusion * Add aggregations too * Mute tests for versions between 8.7-8.10 * Remove mute * Restore version skipping for position fields * Restore version skip for synthetic source
….10 (elastic#100805) (elastic#100814) * Don't print synthetic source in mapping for bwc tests * Move comment. * Don't print synthetic source in mapping for bwc tests #2 * Don't print synthetic source in mapping for bwc tests #2 * Revert "Don't print synthetic source in mapping for bwc tests #2" This reverts commit 034262c. * Revert "Don't print synthetic source in mapping for bwc tests #2" This reverts commit 44e8156. * Revert "Don't print synthetic source in mapping for bwc tests (elastic#100572)" This reverts commit 9322ab9. * Exclude synthetic source test from mixedClusterTests * Update comment. * Mute all tsdb tests in mixedClusterTests This is an interim step to stop sporadic test failures, while we try to fix version skip for mixed cluster tests. * Remove old exclusion * Add aggregations too * Mute tests for versions between 8.7-8.10 * Remove mute
…c#100823) * Don't print synthetic source in mapping for bwc tests * Move comment. * Don't print synthetic source in mapping for bwc tests #2 * Don't print synthetic source in mapping for bwc tests #2 * Revert "Don't print synthetic source in mapping for bwc tests #2" This reverts commit 034262c. * Revert "Don't print synthetic source in mapping for bwc tests #2" This reverts commit 44e8156. * Revert "Don't print synthetic source in mapping for bwc tests (elastic#100572)" This reverts commit 9322ab9. * Exclude synthetic source test from mixedClusterTests * Update comment. * Mute all tsdb tests in mixedClusterTests This is an interim step to stop sporadic test failures, while we try to fix version skip for mixed cluster tests. * Remove old exclusion * Add aggregations too * Mute tests for versions between 8.7-8.10 * Remove mute * Restore version skipping for position fields * Restore version skip for synthetic source
When we run the csv-spec tests for ESQL against a real http endpoint we actually run them twice - once async and once sync. But the names of the tests didn't reflect that - they just looked like they were accidentally duplicated. This updates the format. So this: ``` test {string.Trim} test {string.Trim #2} ``` becomes: ``` test {string.Trim ASYNC} test {string.Trim SYNC} ```
…8.7 - 8.10 (elastic#100805) (elastic#100815) * [TEST] Mute all tsdb tests in mixedClusterTests, for versions 8.7 - 8.10 (elastic#100805) * Don't print synthetic source in mapping for bwc tests * Move comment. * Don't print synthetic source in mapping for bwc tests #2 * Don't print synthetic source in mapping for bwc tests #2 * Revert "Don't print synthetic source in mapping for bwc tests #2" This reverts commit 034262c. * Revert "Don't print synthetic source in mapping for bwc tests #2" This reverts commit 44e8156. * Revert "Don't print synthetic source in mapping for bwc tests (elastic#100572)" This reverts commit 9322ab9. * Exclude synthetic source test from mixedClusterTests * Update comment. * Mute all tsdb tests in mixedClusterTests This is an interim step to stop sporadic test failures, while we try to fix version skip for mixed cluster tests. * Remove old exclusion * Add aggregations too * Mute tests for versions between 8.7-8.10 * Remove mute * Fix skip for position fields
…rce (elastic#100827) * [TEST] Mute all tsdb tests in mixedClusterTests, for versions 8.7 - 8.10 (elastic#100805) * Don't print synthetic source in mapping for bwc tests * Move comment. * Don't print synthetic source in mapping for bwc tests #2 * Don't print synthetic source in mapping for bwc tests #2 * Revert "Don't print synthetic source in mapping for bwc tests #2" This reverts commit 034262c. * Revert "Don't print synthetic source in mapping for bwc tests #2" This reverts commit 44e8156. * Revert "Don't print synthetic source in mapping for bwc tests (elastic#100572)" This reverts commit 9322ab9. * Exclude synthetic source test from mixedClusterTests * Update comment. * Mute all tsdb tests in mixedClusterTests This is an interim step to stop sporadic test failures, while we try to fix version skip for mixed cluster tests. * Remove old exclusion * Add aggregations too * Mute tests for versions between 8.7-8.10 * Remove mute * Fix skip for position fields * Restore version skip for synthetic source
…t {stats.Count_or_null SYNC #2} elastic#110950
…alCentroidTests testAggregateIntermediate {TestCase=<geo_point> #2} elastic#112461
…sts testFold {TestCase=<double> #2} elastic#113225
…uginFuncTest builds distribution from branches via archives extractedAssemble [bwcDistVersion: 8.2.1, bwcProject: bugfix, expectedAssembleTaskName: extractedAssemble, #2] elastic#119871
Please don't actually merge this. I'd rather we use git trickery to update your branch without merging this PR. But I did want some easy way to say "look at what I've done here since we last spoke" and this is a half decent way of doing that.
Annoyingly there's some (IMHO) unnecessary noise because I merged master in.
In conclusion, reiterating: please don't actually merge this.
❤️