Skip to content

Created an API to fetch remote store metadata #18257

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Sukriti0717
Copy link

@Sukriti0717 Sukriti0717 commented May 12, 2025

Added Remote Store Metadata API to fetch segment and translog metadata

Description

This PR adds a new cluster-level API that enables users to retrieve remote store metadata, including segment and translog details, for specific indices and shards. This functionality enhances observability and debugging capabilities for indices backed by remote storage.

Key Changes

  1. Transport Layer: TransportRemoteStoreMetadataAction:
  • Executes on the Data node.
  • Collects and parses segment and translog metadata files for each shard.
  • Handles shard-level errors gracefully.
  1. Core Action Classes
  • RemoteStoreMetadataRequest: Supports input parameters: index name and optional shard ID(s).
  • RemoteStoreMetadataResponse: Contains per-shard metadata along with success/failure info
  • RemoteStoreMetadata: Holds the parsed segment and translog metadata per shard.
  • RemoteStoreMetadataAction: Registers the action under cluster:admin/remote_store/metadata.
  • RemoteStoreMetadataRequestBuilder: Provides fluent client-side request building.
  1. REST API: RestRemoteStoreMetadataAction
  • New endpoints:
    • GET /_remotestore/metadata/{index}
    • GET /_remotestore/metadata/{index}/{shard_id} - Supports optional query param: ?local=true
  • Internally calls the transport action and returns structured JSON.
  1. Client Integration
  • Updates to ClusterAdminClient and AbstractClient:
    • remoteStoreMetadata(RemoteStoreMetadataRequest, ActionListener)
    • prepareRemoteStoreMetadata(String index, String shardId)

Sample Response

GET "localhost:9200/_remotestore/metadata/my-index-1?pretty"

{
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "failed" : 0
  },
  "indices" : {
    "my-index-1" : {
      "shards" : {
        "0" : [
          {
            "index" : "my-index-1",
            "shard" : 0,
            "latest_segment_metadata_filename" : "metadata__9223372036854775806__9223372036854775804__9223372036854775803__9223372036854775805__-1084812520__9223370287071596565__2",
            "latest_translog_metadata_filename" : "metadata__9223372036854775806__9223372036854775804__9223370287071596713__-1084812520__9223372036854775804__1__1",
            "available_segment_metadata_files" : {
              "metadata__9223372036854775806__9223372036854775804__9223372036854775803__9223372036854775805__-1084812520__9223370287071596565__2" : {
                "files" : {
                  "_0.cfe" : {
                    "original_name" : "_0.cfe",
                    "checksum" : "624593751",
                    "length" : 517
                  },
                  "_0.si" : {
                    "original_name" : "_0.si",
                    "checksum" : "3210944240",
                    "length" : 324
                  },
                  "_0.cfs" : {
                    "original_name" : "_0.cfs",
                    "checksum" : "705023748",
                    "length" : 3933
                  },
                  "segments_3" : {
                    "original_name" : "segments_3",
                    "checksum" : "1916983394",
                    "length" : 230
                  }
                },
                "replication_checkpoint" : {
                  "segment_infos_version" : 9,
                  "codec" : "Lucene101",
                  "length" : 4774,
                  "created_timestamp" : 163477705159875,
                  "segments_gen" : 3,
                  "primary_term" : 1
                }
              },
              "metadata__9223372036854775806__9223372036854775804__9223372036854775804__9223372036854775806__-1084812520__9223370287071600820__2" : {
                "files" : {
                  "segments_3" : {
                    "original_name" : "segments_3",
                    "checksum" : "1916983394",
                    "length" : 230
                  }
                },
                "replication_checkpoint" : {
                  "segment_infos_version" : 7,
                  "codec" : "Lucene101",
                  "length" : 0,
                  "created_timestamp" : 163472814252458,
                  "segments_gen" : 3,
                  "primary_term" : 1
                }
              }
            },
            "available_translog_metadata_files" : {
              "metadata__9223372036854775806__9223372036854775804__9223370287071596713__-1084812520__9223372036854775804__1__1" : {
                "generation" : 3,
                "generation_to_primary_term" : {
                  "3" : "1"
                },
                "min_translog_gen" : 3,
                "primary_term" : 1
              },
              "metadata__9223372036854775806__9223372036854775805__9223370287071601448__-1084812520__9223372036854775805__1__1" : {
                "generation" : 2,
                "generation_to_primary_term" : {
                  "2" : "1"
                },
                "min_translog_gen" : 2,
                "primary_term" : 1
              }
            }
          }
        ]
      }
    }
  }
}

@Sukriti0717 Sukriti0717 requested review from peternied and a team as code owners May 12, 2025 07:04
@gbbafna gbbafna marked this pull request as draft May 12, 2025 07:06
Copy link
Contributor

❌ Gradle check result for 2e31b7f: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

❌ Gradle check result for c3433c6: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@Sukriti0717 Sukriti0717 force-pushed the remote-store-metadata-api branch from c3433c6 to 73c9694 Compare May 12, 2025 09:02
Copy link
Contributor

❌ Gradle check result for 73c9694: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

❌ Gradle check result for f706bd0: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@Sukriti0717 Sukriti0717 force-pushed the remote-store-metadata-api branch from f706bd0 to f368d9e Compare May 15, 2025 06:51
Copy link
Contributor

❌ Gradle check result for f368d9e: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@Sukriti0717 Sukriti0717 force-pushed the remote-store-metadata-api branch from 196da8f to c1e02e2 Compare May 16, 2025 09:14
Copy link
Contributor

❌ Gradle check result for c1e02e2: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

❌ Gradle check result for c013578: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@Sukriti0717 Sukriti0717 force-pushed the remote-store-metadata-api branch from c013578 to 2a61841 Compare May 20, 2025 17:00
Copy link
Contributor

❌ Gradle check result for 2a61841: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@Sukriti0717 Sukriti0717 force-pushed the remote-store-metadata-api branch from 2a61841 to 77e4f53 Compare May 22, 2025 08:48
@Sukriti0717 Sukriti0717 changed the title Created an API to fetch remote store segment data Created an API to fetch remote store metadata May 22, 2025
Copy link
Contributor

❌ Gradle check result for 432cc70: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@Sukriti0717 Sukriti0717 force-pushed the remote-store-metadata-api branch from 432cc70 to b3ed29d Compare May 25, 2025 18:56
Copy link
Contributor

❌ Gradle check result for b3ed29d: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@Sukriti0717 Sukriti0717 force-pushed the remote-store-metadata-api branch from b3ed29d to 1476131 Compare May 28, 2025 04:25
Copy link
Contributor

❌ Gradle check result for 1476131: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@Sukriti0717 Sukriti0717 force-pushed the remote-store-metadata-api branch from 1476131 to d92ef51 Compare May 28, 2025 06:41
Copy link
Contributor

❌ Gradle check result for d92ef51: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@Sukriti0717 Sukriti0717 marked this pull request as ready for review May 28, 2025 07:33
Copy link
Contributor

❌ Gradle check result for 722d6dd: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

❌ Gradle check result for 722d6dd: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

❕ Gradle check result for 722d6dd: UNSTABLE

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

Copy link
Contributor

❌ Gradle check result for 1d07935: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@Sukriti0717 Sukriti0717 force-pushed the remote-store-metadata-api branch from 1d07935 to 1612b2f Compare June 13, 2025 03:41
Copy link
Contributor

❌ Gradle check result for 1612b2f: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

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.

3 participants