usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From toddn...@apache.org
Subject incubator-usergrid git commit: Moved add alias and test new index into try so we don't keep moving the index alias
Date Mon, 09 Mar 2015 02:14:40 GMT
Repository: incubator-usergrid
Updated Branches:
  refs/heads/rebuild-fix [created] d164ff141


Moved add alias and test new index into try so we don't keep moving the index alias


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/d164ff14
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/d164ff14
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/d164ff14

Branch: refs/heads/rebuild-fix
Commit: d164ff141ed3e0476a8279855812d5139f0d6a91
Parents: 3b409f6
Author: Todd Nine <tnine@apigee.com>
Authored: Sun Mar 8 20:14:37 2015 -0600
Committer: Todd Nine <tnine@apigee.com>
Committed: Sun Mar 8 20:14:37 2015 -0600

----------------------------------------------------------------------
 .../usergrid/persistence/index/impl/EsEntityIndexImpl.java  | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/d164ff14/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
index d980401..9f8ca67 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
@@ -216,14 +216,19 @@ public class EsEntityIndexImpl implements AliasedEntityIndex {
                         .execute()
                         .actionGet();
                 timeNewIndexCreation.stop();
+
+                //ONLY add the alias if we create the index, otherwise we're going to overwrite
production settings
+                addAlias(normalizedSuffix);
+
+                testNewIndex();
+
                 logger.info("Created new Index Name [{}] ACK=[{}]", indexName, cir.isAcknowledged());
             } catch (IndexAlreadyExistsException e) {
                 logger.info("Index Name [{}] already exists", indexName);
             }
 
-            addAlias(normalizedSuffix);
 
-            testNewIndex();
+
         } catch (IndexAlreadyExistsException expected) {
             // this is expected to happen if index already exists, it's a no-op and swallow
         } catch (IOException e) {


Mime
View raw message