accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ktur...@apache.org
Subject [accumulo] branch master updated: fix #1139 preventing 1.9 and 2.0 servers from communicating (#1143)
Date Wed, 01 May 2019 21:37:41 GMT
This is an automated email from the ASF dual-hosted git repository.

kturner pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/master by this push:
     new aca7482  fix #1139 preventing 1.9 and 2.0 servers from communicating (#1143)
aca7482 is described below

commit aca748263f2fb19c35c47cde22d62afe17f9789a
Author: Keith Turner <kturner@apache.org>
AuthorDate: Wed May 1 17:37:37 2019 -0400

    fix #1139 preventing 1.9 and 2.0 servers from communicating (#1143)
---
 .../main/java/org/apache/accumulo/server/ServerConstants.java |  7 -------
 .../apache/accumulo/server/security/SystemCredentials.java    | 11 ++++++++---
 2 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/server/base/src/main/java/org/apache/accumulo/server/ServerConstants.java b/server/base/src/main/java/org/apache/accumulo/server/ServerConstants.java
index 09d5c92..62a4821 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/ServerConstants.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/ServerConstants.java
@@ -44,13 +44,6 @@ public class ServerConstants {
   public static final String INSTANCE_ID_DIR = "instance_id";
 
   /**
-   * current version (3) reflects additional namespace operations (ACCUMULO-802) in version
-   * 1.6.0<br>
-   * (versions should never be negative)
-   */
-  public static final Integer WIRE_VERSION = 3;
-
-  /**
    * version (9) reflects changes to crypto that resulted in RFiles and WALs being serialized
    * differently in version 2.0.0. Also RFiles in 2.0.0 may have summary data.
    */
diff --git a/server/base/src/main/java/org/apache/accumulo/server/security/SystemCredentials.java
b/server/base/src/main/java/org/apache/accumulo/server/security/SystemCredentials.java
index 52b50af..1963288 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/security/SystemCredentials.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/security/SystemCredentials.java
@@ -33,7 +33,6 @@ import org.apache.accumulo.core.clientImpl.Credentials;
 import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.core.conf.SiteConfiguration;
 import org.apache.accumulo.core.securityImpl.thrift.TCredentials;
-import org.apache.accumulo.server.ServerConstants;
 import org.apache.hadoop.io.Writable;
 
 /**
@@ -83,6 +82,12 @@ public final class SystemCredentials extends Credentials {
   public static final class SystemToken extends PasswordToken {
 
     /**
+     * Accumulo servers will only communicate with each other when this is the same. Bumped
for 2.0
+     * to prevent 1.9 and 2.0 servers from communicating.
+     */
+    private static final Integer INTERNAL_WIRE_VERSION = 4;
+
+    /**
      * A Constructor for {@link Writable}.
      */
     public SystemToken() {}
@@ -102,7 +107,7 @@ public final class SystemCredentials extends Credentials {
       }
 
       // seed the config with the version and instance id, so at least it's not empty
-      md.update(ServerConstants.WIRE_VERSION.toString().getBytes(UTF_8));
+      md.update(INTERNAL_WIRE_VERSION.toString().getBytes(UTF_8));
       md.update(instanceIdBytes);
 
       for (Entry<String,String> entry : siteConfig) {
@@ -114,7 +119,7 @@ public final class SystemCredentials extends Credentials {
       }
       confChecksum = md.digest();
 
-      int wireVersion = ServerConstants.WIRE_VERSION;
+      int wireVersion = INTERNAL_WIRE_VERSION;
 
       ByteArrayOutputStream bytes = new ByteArrayOutputStream(
           3 * (Integer.SIZE / Byte.SIZE) + instanceIdBytes.length + confChecksum.length);


Mime
View raw message