Skip to content

Conversation

salvatore-campagna
Copy link
Contributor

@salvatore-campagna salvatore-campagna commented Sep 10, 2024

Here we test reindexing logsdb indices, creating and restoring snapshots. Note that logsdb uses synthetic source and restoring source-only snapshots fails due to missing _source.

Resolves #109803

Here we test reindexing logsdb indices, creating and restoring
snapshots. Note that logsdb uses synthetic source and restoring
source only snapshots fails due to missing _source.
@salvatore-campagna salvatore-campagna added >test Issues or PRs that are addressing/adding tests :StorageEngine/Logs You know, for Logs v8.16.0 labels Sep 10, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-storage-engine (Team:StorageEngine)

assertOK(client.performRequest(reindexRequest));
assertDataStreamBackingIndexMode("standard", 0, "standard-apache-kafka");
assertThat(
entityAsMap(client.performRequest(new Request("POST", "/standard-apache-kafka/_count"))).get("count"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we check that documents look correct?

Copy link
Contributor Author

@salvatore-campagna salvatore-campagna Sep 11, 2024

Choose a reason for hiding this comment

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

What do you exactly mean when saying "look correct"? I think it is not up to thins kind of test including that they match.

Copy link
Contributor

@lkts lkts Sep 12, 2024

Choose a reason for hiding this comment

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

I agree that this is not an ideal place to test reindex operation itself but AFAIK there are currently no tests for this. Do we have an item for that? I was thinking that such a simple document should be identical even with synthetic _source and therefore we could get at least an initial test for that behavior.

putTemplate(client, "standard-template", STANDARD_TEMPLATE);
createDataStream(client, "standard-apache-kafka");

// Index some documents in LogsDB
Copy link
Contributor

Choose a reason for hiding this comment

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

The name of the test is testStandardToLogsDBReindex but the test is doing the opposite - it reindexes form logsdb to standard.

putTemplate(client, "standard-template", STANDARD_TEMPLATE);
createDataStream(client, "standard-apache-kafka");

// Index some documents in LogsDB
Copy link
Contributor

Choose a reason for hiding this comment

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

in standard

Matchers.equalTo(10)
);

// Reindex LogsDB data stream into a standard data stream
Copy link
Contributor

Choose a reason for hiding this comment

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

standard into logsdb

mountRequest.setJsonEntity("{\"index\": \"" + index + "\",\"renamed_index\": \"" + restoreIndex + "\"}");
assertOK(client.performRequest(mountRequest));

assertThat(
Copy link
Contributor

Choose a reason for hiding this comment

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

Same - can we check documents?

@salvatore-campagna
Copy link
Contributor Author

salvatore-campagna commented Sep 11, 2024

@lkts this was not ready for review yet...I pushed to see CI results.

@lkts
Copy link
Contributor

lkts commented Sep 11, 2024

@salvatore-campagna lol sorry about that. Can you mark it as draft then?

@salvatore-campagna
Copy link
Contributor Author

salvatore-campagna commented Sep 12, 2024

@salvatore-campagna lol sorry about that. Can you mark it as draft then?

I usually wait at least for a round of CI to be green or, at least to see if there is anything wrong and then I ask for a review selecting reviewers. I do this to avoid wasting people time reviewing something that is not ready yet. I rarely use draft PRs.

@salvatore-campagna salvatore-campagna requested review from kkrik-es, lkts and martijnvg and removed request for kkrik-es September 12, 2024 13:24
Copy link
Member

@martijnvg martijnvg left a comment

Choose a reason for hiding this comment

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

lgtm

@salvatore-campagna salvatore-campagna merged commit f7880ae into elastic:main Sep 17, 2024
15 checks passed
javanna pushed a commit to javanna/elasticsearch that referenced this pull request Sep 18, 2024
Here we test reindexing logsdb indices, creating and restoring
snapshots. Note that logsdb uses synthetic source and restoring
source only snapshots fails due to missing _source.
@salvatore-campagna
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.x

Questions ?

Please refer to the Backport tool documentation

salvatore-campagna added a commit to salvatore-campagna/elasticsearch that referenced this pull request Sep 24, 2024
Here we test reindexing logsdb indices, creating and restoring
snapshots. Note that logsdb uses synthetic source and restoring
source only snapshots fails due to missing _source.

(cherry picked from commit f7880ae)
elasticsearchmachine pushed a commit that referenced this pull request Sep 24, 2024
Here we test reindexing logsdb indices, creating and restoring
snapshots. Note that logsdb uses synthetic source and restoring
source only snapshots fails due to missing _source.

(cherry picked from commit f7880ae)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:StorageEngine/Logs You know, for Logs Team:StorageEngine >test Issues or PRs that are addressing/adding tests v9.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LogsDB - Data Migration Testing

5 participants