You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@usergrid.apache.org by shawnfeldman <gi...@git.apache.org> on 2014/12/10 20:03:38 UTC

[GitHub] incubator-usergrid pull request: add more index protections when c...

GitHub user shawnfeldman opened a pull request:

    https://github.com/apache/incubator-usergrid/pull/121

    add more index protections when creating alias

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/incubator-usergrid USERGRID-274

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-usergrid/pull/121.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #121
    
----
commit fe4b193df87ecbc8092707fe3be57568a8ea2f85
Author: Shawn Feldman <sf...@apache.org>
Date:   2014-12-10T18:49:28Z

    add more index protections when creating alias

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-usergrid pull request: add more index protections when c...

Posted by tnine <gi...@git.apache.org>.
Github user tnine commented on a diff in the pull request:

    https://github.com/apache/incubator-usergrid/pull/121#discussion_r21642917
  
    --- Diff: stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java ---
    @@ -181,33 +182,41 @@ public void addIndex(final String indexSuffix,final int numberOfShards, final in
     
         @Override
         public void addAlias(final String indexSuffix) {
    -        try {
    -            Boolean isAck;
    -            String indexName = indexIdentifier.getIndex(indexSuffix);
    -            final AdminClient adminClient = esProvider.getClient().admin();
    +        Boolean isAck;
    +        String indexName = indexIdentifier.getIndex(indexSuffix);
    +        final AdminClient adminClient = esProvider.getClient().admin();
    +
    +        String[] indexNames = getIndexes(AliasType.Write);
     
    -            String[] indexNames = getIndexes(AliasType.Write);
    +        for (String currentIndex : indexNames) {
    +            try {
     
    -            for(String currentIndex : indexNames){
                     isAck = adminClient.indices().prepareAliases().removeAlias(currentIndex,
                             alias.getWriteAlias()).execute().actionGet().isAcknowledged();
    +                logger.info("Removed Index Name [{}] from Alias=[{}] ACK=[{}]", currentIndex, alias, isAck);
     
    -                logger.info("Removed Index Name [{}] from Alias=[{}] ACK=[{}]",currentIndex, alias, isAck);
    +            } catch (ElasticsearchException e) {
    +                logger.warn("Failed to remove index from alias {}", alias.getWriteAlias(), e);
    --- End diff --
    
    Can we be more specific about the exceptions we're attempting to catch?  I.E only catch + log + swallow specific subclasses of ElasticsearchException?  I'm concerned we may end up swallowing runtime exceptions we should re-throw.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-usergrid pull request: add more index protections when c...

Posted by tnine <gi...@git.apache.org>.
Github user tnine commented on the pull request:

    https://github.com/apache/incubator-usergrid/pull/121#issuecomment-66558851
  
    Closing, after reviewing some errors I was seeing in ES, they're harmless.  They are the result of the way ES logs, closing this issue.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-usergrid pull request: add more index protections when c...

Posted by shawnfeldman <gi...@git.apache.org>.
Github user shawnfeldman closed the pull request at:

    https://github.com/apache/incubator-usergrid/pull/121


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---