[ 
https://issues.apache.org/jira/browse/PHOENIX-1107?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14123810#comment-14123810
 ] 

Jesse Yates commented on PHOENIX-1107:
--------------------------------------

The reason this works (at least in HBase 0.98, so Phoenix-4.X) is that the 
"should we replicate this" mechanism is inherently different in 0.98. Here's 
the code:
{code}
  @Override
  public void visitLogEntryBeforeWrite(HTableDescriptor htd, HLogKey logKey,
                                       WALEdit logEdit) {
    scopeWALEdits(htd, logKey, logEdit);
  }

 public static void scopeWALEdits(HTableDescriptor htd, HLogKey logKey,
                                   WALEdit logEdit) {
    NavigableMap<byte[], Integer> scopes =
        new TreeMap<byte[], Integer>(Bytes.BYTES_COMPARATOR);
    byte[] family;
    for (KeyValue kv : logEdit.getKeyValues()) {
      family = kv.getFamily();
      // This is expected and the KV should not be replicated
      if (kv.matchingFamily(WALEdit.METAFAMILY)) continue;
      // Unexpected, has a tendency to happen in unit tests
      assert htd.getFamily(family) != null;

      int scope = htd.getFamily(family).getScope();
      if (scope != REPLICATION_SCOPE_LOCAL &&
          !scopes.containsKey(family)) {
        scopes.put(family, scope);
      }
    }
    if (!scopes.isEmpty()) {
      logKey.setScopes(scopes);
    }
  }
{code}

which is inherently different from the WAL logic in my first comment on this 
JIRA.

I think we can mark this is Won't Fix and move on.

> Support mutable indexes over replication
> ----------------------------------------
>
>                 Key: PHOENIX-1107
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1107
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 5.0.0, 3.1, 4.1
>            Reporter: Jesse Yates
>            Assignee: Jesse Yates
>         Attachments: phoenix-1107-3.0.v0, phoenix-1107-master-passes.patch
>
>
> Mutable indexes don't support usage with replication. For starters, the 
> replication WAL Listener checks the family of the edits, which can throw a 
> NPE for the IndexedKeyValue 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to