Skip to content

Fix IndexShardIT.testIndexCanChangeCustomDataPath()#43978

Merged
tlrx merged 1 commit intoelastic:7.xfrom
tlrx:fix-testIndexCanChangeCustomDataPath-on-7.x
Jul 4, 2019
Merged

Fix IndexShardIT.testIndexCanChangeCustomDataPath()#43978
tlrx merged 1 commit intoelastic:7.xfrom
tlrx:fix-testIndexCanChangeCustomDataPath-on-7.x

Conversation

@tlrx
Copy link
Copy Markdown
Member

@tlrx tlrx commented Jul 4, 2019

The test IndexShardIT.testIndexCanChangeCustomDataPath() fails on 7.x and 7.3 because the translog cannot be recovered.

While I can't reproduce the issue, I think it has been introduced in #43752 which changed ReadOnlyEngine so that it opens the translog in its constructor in order to load the translog stats. This opening writes a new checkpoint file, but because 7.x/7.3 does not wait for shards to be started after being closed, the test immediately starts to copy shard files to a new directory and possibly does not copy all the
required translog files.

By waiting for the shards to be started after being closed, we ensure that the shards (and engines) have been correctly initialized and that the translog checkpoint file is not currently being written.

closes #43964

@tlrx tlrx added >test Issues or PRs that are addressing/adding tests :Distributed/Engine Anything around managing Lucene and the Translog in an open shard. v7.3.0 v7.4.0 labels Jul 4, 2019
@tlrx tlrx requested a review from ywelsch July 4, 2019 12:57
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-distributed

Copy link
Copy Markdown
Contributor

@ywelsch ywelsch left a comment

Choose a reason for hiding this comment

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

LGTM

@tlrx tlrx merged commit b037aea into elastic:7.x Jul 4, 2019
@tlrx tlrx deleted the fix-testIndexCanChangeCustomDataPath-on-7.x branch July 4, 2019 15:06
@tlrx
Copy link
Copy Markdown
Member Author

tlrx commented Jul 4, 2019

Thanks @ywelsch

tlrx added a commit that referenced this pull request Jul 4, 2019
The test IndexShardIT.testIndexCanChangeCustomDataPath() fails
 on 7.x and 7.3 because the translog cannot be recovered.

While I can't reproduce the issue, I think it has been introduced in #43752 
which changed ReadOnlyEngine so that it opens the translog in its 
constructor in order to load the translog stats. This opening writes a 
new checkpoint file, but because 7.x/7.3 does not wait for shards to be 
started after being closed, the test immediately starts to copy shard files
 to a new directory and possibly does not copy all the required translog files.

By waiting for the shards to be started after being closed, we ensure 
that the shards (and engines) have been correctly initialized and that
 the translog checkpoint file is not currently being written.

closes #43964
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Distributed/Engine Anything around managing Lucene and the Translog in an open shard. >test Issues or PRs that are addressing/adding tests v7.3.0 v7.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants