Skip to content
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

Upload global cluster state to remote store #10404

Merged

Conversation

dhwanilpatel
Copy link
Contributor

@dhwanilpatel dhwanilpatel commented Oct 5, 2023

Description

Changes for uploading global metadata to remote store.

We will store all global metadata in single file in remote store. For incremental update we will check if global metadata has changed or not, if not then we will skip uploading it and if it has changed we will upload full global metadata to remote store.

Directory structure will look like this:

base folder/
    |
    |--> index/
    |     | --> index_UUID/
    |              | --> metadata__<inverted_index_metadata_version>__<inverted_codec_version>__<timestamp>.dat
    |              | --> metadata__<inverted_index_metadata_version>__<inverted_codec_version>__<timestamp>.dat  
    |
    |--> global-metadata/
    |       | --> metadata__<inverted_metadata_version>__<inverted_codec_version>__<timestamp>.dat
    |
    |
    |--> manifest/
    |       | --> manifest__<inverted_term>__<inverted_version>__<inverted_codec_version>__<timestamp>
    |       | --> manifest__<inverted_term>__<inverted_version>__<inverted_codec_version>__<timestamp>

Related Issues

#10526

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)
  • GitHub issue/PR created in OpenSearch documentation repo for the required public documentation changes (#[Issue/PR number])

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Dhwanil Patel <dhwanip@amazon.com>
@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2023

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2023

Compatibility status:

Checks if related components are compatible with change 1aa7bcf

Incompatible components

Skipped components

Compatible components

Compatible components: [https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/custom-codecs.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git, https://github.com/opensearch-project/performance-analyzer.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/neural-search.git]

Copy link
Collaborator

@Bukhtawar Bukhtawar left a comment

Choose a reason for hiding this comment

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

Thanks Dhwanil. Can you show the complete directory structure including index metadata to get a sense of the blob structure

Signed-off-by: Dhwanil Patel <dhwanip@amazon.com>
Signed-off-by: Dhwanil Patel <dhwanip@amazon.com>
@dhwanilpatel
Copy link
Contributor Author

dhwanilpatel commented Oct 6, 2023

Thanks Dhwanil. Can you show the complete directory structure including index metadata to get a sense of the blob structure

This will be sample directory structure:

base folder/
    |
    |--> index/
    |     | --> index_UUID/
    |              | --> metadata__<index_metadata_version>__<timestamp>.dat
    |              | --> metadata__<index_metadata_version>__<timestamp>.dat  
    |
    |--> global-metadata/
    |       | --> meta-global-metadata__<codec_version>__<timestamp>.dat
    |       | --> meta-global-metadata__<codec_version>__<timestamp>.dat
    |
    |
    |--> manifest/
    |       | --> manifest__<term>__<version>__<timestamp>
    |       | --> manifest__<term>__<version>__<timestamp>

@github-actions
Copy link
Contributor

github-actions bot commented Oct 6, 2023

Gradle Check (Jenkins) Run Completed with:

@shwetathareja
Copy link
Member

Thanks Dhwanil. Can you show the complete directory structure including index metadata to get a sense of the blob structure

This will be sample directory structure:

base folder/
    |
    |--> index/
    |     | --> index_UUID/
    |              | --> metadata__<index_metadata_version>__<timestamp>.dat
    |              | --> metadata__<index_metadata_version>__<timestamp>.dat  
    |
    |--> global-metadata/
    |       | --> meta-global-metadata__<codec_version>__<timestamp>.dat
    |       | --> meta-global-metadata__<codec_version>__<timestamp>.dat
    |
    |
    |--> manifest/
    |       | --> manifest__<term>__<version>__<timestamp>
    |       | --> manifest__<term>__<version>__<timestamp>

@dhwanilpatel what is the codec version here? The global metadata file should contain Metadata version as well.

@Bukhtawar
Copy link
Collaborator

Thanks Dhwanil. Can you show the complete directory structure including index metadata to get a sense of the blob structure

This will be sample directory structure:

base folder/
    |
    |--> index/
    |     | --> index_UUID/
    |              | --> metadata__<index_metadata_version>__<timestamp>.dat
    |              | --> metadata__<index_metadata_version>__<timestamp>.dat  
    |
    |--> global-metadata/
    |       | --> meta-global-metadata__<codec_version>__<timestamp>.dat
    |       | --> meta-global-metadata__<codec_version>__<timestamp>.dat
    |
    |
    |--> manifest/
    |       | --> manifest__<term>__<version>__<timestamp>
    |       | --> manifest__<term>__<version>__<timestamp>

@dhwanilpatel what is the codec version here? The global metadata file should contain Metadata version as well.

I guess the codec version here is the format of the meta-global-metadata file for future extensibility. The Metadata version will be serialised into the XContent format and should be available when reading?

@shwetathareja
Copy link
Member

shwetathareja commented Oct 9, 2023

The Metadata version will be serialised into the XContent format and should be available when reading?

The Metadata file path should contain the version as well, timestamp is just for preventing overwrites in case of multiple uploads. Also why do you need a separate codec version when cluster version is already written in manifest file.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 9, 2023

Gradle Check (Jenkins) Run Completed with:

@Bukhtawar
Copy link
Collaborator

Bukhtawar commented Oct 9, 2023

The Metadata version will be serialised into the XContent format and should be available when reading?

The Metadata file path should contain the version as well, timestamp is just for preventing overwrites in case of multiple uploads. Also why do you need a separate codec version when cluster version is already written in manifest file.

We discussed this offline and think, would be better to revisit versioning, essentially each file needs to have the file format versioned and the file format version should be surfaced to the file name to ensure we know how to parse the file if the underlying file format changes in future. Essentially having two different versions

  1. File format version — Applicable to manifest and other files where lets say format of the manifest file changes. To handle BWC from a pure file parsing logic
  2. Index/Engine/Cluster metadata compatibility version — To handle BWC at the engine level or maintaining any internal state consistency specific to the internal working of OpenSearch

Signed-off-by: Dhwanil Patel <dhwanip@amazon.com>
@github-actions
Copy link
Contributor

github-actions bot commented Oct 9, 2023

Gradle Check (Jenkins) Run Completed with:

@dhwanilpatel dhwanilpatel marked this pull request as ready for review October 10, 2023 09:32
@shwetathareja
Copy link
Member

@Bukhtawar @shwetathareja we don't have garbage collection for dangling files of index metadata and global metadata where corresponding manifest upload fails. it will only be eligible for GC when the cluster uuid changes after quorum loss recovery. Should we add a task for this?

@linuxpi yes lets create an issue

Signed-off-by: Dhwanil Patel <dhwanip@amazon.com>
Signed-off-by: Dhwanil Patel <dhwanip@amazon.com>
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

Signed-off-by: Dhwanil Patel <dhwanip@amazon.com>
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

Copy link
Member

@shwetathareja shwetathareja left a comment

Choose a reason for hiding this comment

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

finishing the tests, publishing other comments.

Signed-off-by: Dhwanil Patel <dhwanip@amazon.com>
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

Signed-off-by: Dhwanil Patel <dhwanip@amazon.com>
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.smoketest.SmokeTestMultiNodeClientYamlTestSuiteIT.test {yaml=pit/10_basic/Delete all}

@shwetathareja shwetathareja merged commit 4632f4b into opensearch-project:main Oct 18, 2023
14 checks passed
dhwanilpatel added a commit to dhwanilpatel/OpenSearch-1 that referenced this pull request Oct 18, 2023
* Upload global cluster state to remote store

Signed-off-by: Dhwanil Patel <dhwanip@amazon.com>
dhwanilpatel added a commit to dhwanilpatel/OpenSearch-1 that referenced this pull request Oct 18, 2023
* Upload global cluster state to remote store

Signed-off-by: Dhwanil Patel <dhwanip@amazon.com>
dhwanilpatel added a commit to dhwanilpatel/OpenSearch-1 that referenced this pull request Oct 18, 2023
* Upload global cluster state to remote store

Signed-off-by: Dhwanil Patel <dhwanip@amazon.com>
deshsidd pushed a commit to deshsidd/OpenSearch that referenced this pull request Oct 19, 2023
* Upload global cluster state to remote store

Signed-off-by: Dhwanil Patel <dhwanip@amazon.com>
shwetathareja pushed a commit that referenced this pull request Oct 19, 2023
* Upload global cluster state to remote store

Signed-off-by: Dhwanil Patel <dhwanip@amazon.com>
austintlee pushed a commit to austintlee/OpenSearch that referenced this pull request Oct 23, 2023
* Upload global cluster state to remote store

Signed-off-by: Dhwanil Patel <dhwanip@amazon.com>
shiv0408 pushed a commit to Gaurav614/OpenSearch that referenced this pull request Apr 25, 2024
* Upload global cluster state to remote store

Signed-off-by: Dhwanil Patel <dhwanip@amazon.com>

Signed-off-by: Shivansh Arora <hishiv@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants