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

[ENGINE] Upgrade 3.x segments on engine startup #9899

Merged
merged 1 commit into from
Feb 26, 2015

Conversation

s1monw
Copy link
Contributor

@s1monw s1monw commented Feb 26, 2015

Upgrading 3.x segments have been proven to be error prone especially when it get's to
concurrency. Bugs like LUCENE-6287 cause index corrupting when segmetns are upgraded
concurrently to a merge. To play safe this commit upgrades pending segments without
merging etc. before the engine gets started up.

@s1monw
Copy link
Contributor Author

s1monw commented Feb 26, 2015

@mikemccand can you take a look

@@ -724,4 +726,45 @@ public void delete() {
throw new UnsupportedOperationException("This IndexCommit does not support deletions");
}
}

/**
* Retruns <code>true</code> iff the store contains an index that contains segments that where
Copy link
Contributor

Choose a reason for hiding this comment

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

Retruns -> Returns

where -> were

@s1monw
Copy link
Contributor Author

s1monw commented Feb 26, 2015

@mikemccand @kimchy pushed a new commit

.setMergePolicy(NoMergePolicy.INSTANCE)
.setOpenMode(IndexWriterConfig.OpenMode.APPEND))) {
Map<String, String> commitData = iw.getCommitData();
iw.setCommitData(commitData);
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe add a comment that you do this to trick IW into committing when it thinks nothing changed :)

@mikemccand
Copy link
Contributor

Left 2 minor comments else LGTM.

@s1monw
Copy link
Contributor Author

s1monw commented Feb 26, 2015

cool thanks, I beefed up the test a bit and applied the feedback

@mikemccand
Copy link
Contributor

LGTM

Upgrading 3.x segments have been proven to be error prone especially when it get's to
concurrency. Bugs like LUCENE-6287 cause index corrupting when segmetns are upgraded
concurrently to a merge. To play safe this commit upgrades pending segments without
merging etc. before the engine gets started up.
@s1monw s1monw force-pushed the upgrade_index_on_engine_startup branch from b8c1af3 to f5b1ba4 Compare February 26, 2015 15:22
@s1monw s1monw merged commit f5b1ba4 into elastic:1.x Feb 26, 2015
@clintongormley clintongormley added :Distributed/Distributed A catch all label for anything in the Distributed Area. If you aren't sure, use this one. :Distributed/Engine Anything around managing Lucene and the Translog in an open shard. and removed :Engine :Distributed/Distributed A catch all label for anything in the Distributed Area. If you aren't sure, use this one. labels Feb 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Distributed/Engine Anything around managing Lucene and the Translog in an open shard. resiliency v1.4.4 v1.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants