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

Fix upgrade logic to check for major version bump. #8013

Closed
wants to merge 12 commits into from

Conversation

rjernst
Copy link
Member

@rjernst rjernst commented Oct 7, 2014

I had not noticed this since I was only testing using bwc tests, which only go back to ES 1.1 (which is still lucene 4.x).

@s1monw
Copy link
Contributor

s1monw commented Oct 8, 2014

That LGTM can we maybe have a test that has a zipped shard from a 0.20 version that get's upgraded? no need to do this here

@rjernst
Copy link
Member Author

rjernst commented Oct 10, 2014

Ok, added a test. Thanks for the help with the integration. I also cleaned up the UpgradeTest a bit so the checks could be reused. I still want to add a final validation using the segments api that t he index is completely upgraded.

@@ -114,6 +115,7 @@ public static SearchRequest parseSearchRequest(RestRequest request) {
}

searchRequest.types(Strings.splitStringByCommaToArray(request.param("type")));
System.out.println("TYPES IN REQUEST: " + StringUtils.join(searchRequest.types(), ", "));
Copy link
Contributor

Choose a reason for hiding this comment

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

leftover?

@s1monw
Copy link
Contributor

s1monw commented Oct 11, 2014

added minor comments - LGTM otherwise

@s1monw s1monw removed the review label Oct 11, 2014
import static org.hamcrest.Matchers.is;

@ElasticsearchIntegrationTest.ClusterScope(scope = ElasticsearchIntegrationTest.Scope.TEST, numDataNodes = 0, minNumDataNodes = 0, maxNumDataNodes = 0)
public class UpgradeReallyOldIndexTest extends ElasticsearchIntegrationTest {
Copy link
Member

Choose a reason for hiding this comment

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

Maybe specify how old in the class name instead of "really old"?

Copy link
Member

Choose a reason for hiding this comment

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

Does this need scope TEST or SUITE?

Copy link
Member Author

Choose a reason for hiding this comment

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

The scope is TEST, so that more tests can be added for "old" indexes. The name is purposefully general, so that any tests for indexes older than can be tested in normal backcompat tests can be tested (assuming this eventually is worked out to a general test class or something).

@rjernst
Copy link
Member Author

rjernst commented Oct 11, 2014

@javanna I think I addressed all your comments.

@rjernst
Copy link
Member Author

rjernst commented Oct 12, 2014

@s1monw I get random failures sometimes, where flush failed so nothing to upgrade, or an extra flush seems to have happened so that there are no segments to be recovered. Can double check how I'm doing the flush in UpgradeTest?

@rjernst
Copy link
Member Author

rjernst commented Oct 12, 2014

Ok, test is passing consistently now.

@@ -84,59 +88,109 @@ public void testUpgrade() throws Exception {
}
indexRandom(true, builder);
ensureGreen(indexName);
flushAndRefresh();
if (globalCompatibilityVersion().before(Version.V_1_4_0_Beta1)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

can you please leave a comment why we did it that way?

@s1monw
Copy link
Contributor

s1monw commented Oct 12, 2014

LGTM left two minor comments but you can squash and push once fixed

@rjernst rjernst closed this in 538c44b Oct 13, 2014
rjernst added a commit that referenced this pull request Oct 13, 2014
Also improved upgrade tests, and added test against static ES 0.20 index
which used Lucene 3.6.

closes #8013
rjernst added a commit that referenced this pull request Oct 13, 2014
Also improved upgrade tests, and added test against static ES 0.20 index
which used Lucene 3.6.

closes #8013
@clintongormley clintongormley changed the title Fix upgrade logic to check for major version bump. Upgrade API: Fix upgrade logic to check for major version bump. Nov 3, 2014
@rjernst rjernst deleted the fix/upgrade-logic branch January 21, 2015 23:22
@clintongormley clintongormley changed the title Upgrade API: Fix upgrade logic to check for major version bump. Fix upgrade logic to check for major version bump. Jun 7, 2015
mute pushed a commit to mute/elasticsearch that referenced this pull request Jul 29, 2015
Also improved upgrade tests, and added test against static ES 0.20 index
which used Lucene 3.6.

closes elastic#8013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants