-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Port OldIndexBackwardsCompatibilityIT#assertBasicSearchWorks over to full cluster restart qa module #24954
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
Port OldIndexBackwardsCompatibilityIT#assertBasicSearchWorks over to full cluster restart qa module #24954
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a few suggestions for improvement or followups.
Can you remove the OldIndexBackwardsCompatibilityIT#assertBasicSearchWorks
method so we're sure we've ported it?
docBuilder.field("bool", randomBoolean()); | ||
docBuilder.field("field.with.dots", Integer.toString(randomInt(100))); | ||
docBuilder.endObject(); | ||
client().performRequest("PUT", "/index/doc/" + Integer.toString(doc), Collections.emptyMap(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you need the Integer.toString
bit.
assertEquals(numDocs1, numDocs2); | ||
} | ||
|
||
static Map<String, Object> consume(Response response) throws IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe Map<String, Object> toMap(Response response)
?
@@ -64,6 +69,96 @@ protected boolean preserveReposUponCompletion() { | |||
return true; | |||
} | |||
|
|||
public void testOldIndexBwc() throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe testSearch
instead?
I think it'd be nice to move some of the random document generation from testRandomDocumentsAndSnapshot
below into this and just use testRandomDocumentsAndSnapshot
for testing the translog stuff.
logger.info("Found {} in old index", numDocs1); | ||
|
||
logger.info("--> testing basic search with sort"); | ||
String searchRequestBody = "{ \"sort\": [{ \"long_sort\" : \"asc\" }]}"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it should just be long
instead of long_sort
.
@nik9000 I've updated the PR, based on your feedback. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a minor but otherwise LGTM.
new StringEntity(mappingsAndSettings.string(), ContentType.APPLICATION_JSON)); | ||
|
||
int numDocs = randomIntBetween(2000, 3000); | ||
indexRandomDocuments("index", numDocs, false, i -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can allow flush here, I think.
bca98cb
to
0d1a487
Compare
…full cluster restart qa module. Relates to elastic#24939
0d1a487
to
9531ef2
Compare
Relates to #24939