You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by yo...@apache.org on 2019/12/30 15:49:49 UTC
[lucene-solr] branch jira/SOLR-13101 updated: SOLR-13813:
split-test: prohibit update failures, randomize commits
This is an automated email from the ASF dual-hosted git repository.
yonik pushed a commit to branch jira/SOLR-13101
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git
The following commit(s) were added to refs/heads/jira/SOLR-13101 by this push:
new 8429a1c SOLR-13813: split-test: prohibit update failures, randomize commits
8429a1c is described below
commit 8429a1c7f6cc2c9e3fcf017212975ade845836a7
Author: yonik <yo...@apache.org>
AuthorDate: Mon Dec 30 10:49:50 2019 -0500
SOLR-13813: split-test: prohibit update failures, randomize commits
---
.../org/apache/solr/store/blob/SharedStorageSplitTest.java | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/solr/core/src/test/org/apache/solr/store/blob/SharedStorageSplitTest.java b/solr/core/src/test/org/apache/solr/store/blob/SharedStorageSplitTest.java
index a7eda9c..fe51cac 100644
--- a/solr/core/src/test/org/apache/solr/store/blob/SharedStorageSplitTest.java
+++ b/solr/core/src/test/org/apache/solr/store/blob/SharedStorageSplitTest.java
@@ -137,12 +137,10 @@ public class SharedStorageSplitTest extends SolrCloudSharedStoreTestCase {
void doSplitShard(String collectionName, boolean sharedStorage, int repFactor, int nPrefixes, int nDocsPerPrefix) throws Exception {
CloudSolrClient client = createCollection(collectionName, sharedStorage, repFactor);
- /*** TODO: this currently causes a failure due to a NPE. Uncomment when fixed.
if (random().nextBoolean()) {
// start off with a commit
client.commit(collectionName, true, true, false);
}
- ***/
indexPrefixDocs(client, collectionName, nPrefixes, nDocsPerPrefix, 0);
@@ -225,7 +223,7 @@ public class SharedStorageSplitTest extends SolrCloudSharedStoreTestCase {
void doLiveSplitShard(String collectionName, boolean sharedStorage, int repFactor, int nThreads) throws Exception {
final boolean doSplit = true; // test debugging aid: set to false if you want to check that the test passes if we don't do a split
- final boolean updateFailureOK = true; // TODO: this should be changed to false after the NPE bug is fixed
+ final boolean updateFailureOK = false; // we should not expect any of our updates to fail without a node failure
final CloudSolrClient client = createCollection(collectionName, sharedStorage, repFactor);
final ConcurrentHashMap<String,Long> model = new ConcurrentHashMap<>(); // what the index should contain
@@ -248,8 +246,13 @@ public class SharedStorageSplitTest extends SolrCloudSharedStoreTestCase {
// Try all docs in the same update request
UpdateRequest updateReq = new UpdateRequest();
updateReq.add(sdoc("id", docId));
- UpdateResponse ursp = updateReq.commit(client, collectionName); // uncomment this if you want a commit each time
- // UpdateResponse ursp = updateReq.process(client, collectionName);
+
+ UpdateResponse ursp;
+ if (random().nextInt(4)==0) { // add commit 25% of the time
+ ursp = updateReq.commit(client, collectionName);
+ } else {
+ ursp = updateReq.process(client, collectionName);
+ }
updateLatch.get().countDown();
if (ursp.getStatus() == 0) {