You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "dlmarion (via GitHub)" <gi...@apache.org> on 2023/04/19 17:45:16 UTC

[GitHub] [accumulo] dlmarion opened a new pull request, #3322: Upgrader for version 4.0.0, set hosting goals on existing tablets

dlmarion opened a new pull request, #3322:
URL: https://github.com/apache/accumulo/pull/3322

   
   Closes #3305


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [accumulo] dlmarion commented on a diff in pull request #3322: Upgrader for version 4.0.0, set hosting goals on existing tablets

Posted by "dlmarion (via GitHub)" <gi...@apache.org>.
dlmarion commented on code in PR #3322:
URL: https://github.com/apache/accumulo/pull/3322#discussion_r1173888863


##########
server/manager/src/main/java/org/apache/accumulo/manager/upgrade/Upgrader11to12.java:
##########
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.accumulo.manager.upgrade;
+
+import org.apache.accumulo.core.client.admin.TabletHostingGoal;
+import org.apache.accumulo.core.data.TableId;
+import org.apache.accumulo.core.metadata.MetadataTable;
+import org.apache.accumulo.core.metadata.RootTable;
+import org.apache.accumulo.core.metadata.schema.Ample.DataLevel;
+import org.apache.accumulo.core.metadata.schema.Ample.TabletsMutator;
+import org.apache.accumulo.core.metadata.schema.TabletMetadata.ColumnType;
+import org.apache.accumulo.core.metadata.schema.TabletsMetadata;
+import org.apache.accumulo.server.ServerContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class Upgrader11to12 implements Upgrader {
+
+  private static final Logger LOG = LoggerFactory.getLogger(Upgrader11to12.class);
+
+  @Override
+  public void upgradeZookeeper(ServerContext context) {
+    LOG.info("setting root table stored hosting goal");
+    addHostingGoalToRootTable(context);
+  }
+
+  @Override
+  public void upgradeRoot(ServerContext context) {
+    LOG.info("setting metadata table hosting goal");
+    addHostingGoalToMetadataTable(context);
+  }
+
+  @Override
+  public void upgradeMetadata(ServerContext context) {
+    LOG.info("setting hosting goal on user tables");
+    addHostingGoalToUserTables(context);
+  }
+
+  private void addHostingGoalToSystemTable(ServerContext context, TableId tableId) {
+    TabletsMetadata tm =

Review Comment:
   Addressed in 4136c63



##########
server/base/src/test/java/org/apache/accumulo/server/ServerContextTest.java:
##########
@@ -18,6 +18,7 @@
  */
 package org.apache.accumulo.server;
 
+import static org.apache.accumulo.server.AccumuloDataVersion.REMOVE_DEPRECATIONS_FOR_VERSION_3;

Review Comment:
   Addressed in 4136c63



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [accumulo] dlmarion commented on a diff in pull request #3322: Upgrader for version 4.0.0, set hosting goals on existing tablets

Posted by "dlmarion (via GitHub)" <gi...@apache.org>.
dlmarion commented on code in PR #3322:
URL: https://github.com/apache/accumulo/pull/3322#discussion_r1172738029


##########
server/manager/src/main/java/org/apache/accumulo/manager/upgrade/Upgrader11to12.java:
##########
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.accumulo.manager.upgrade;
+
+import org.apache.accumulo.core.client.admin.TabletHostingGoal;
+import org.apache.accumulo.core.data.TableId;
+import org.apache.accumulo.core.metadata.MetadataTable;
+import org.apache.accumulo.core.metadata.RootTable;
+import org.apache.accumulo.core.metadata.schema.Ample.DataLevel;
+import org.apache.accumulo.core.metadata.schema.Ample.TabletsMutator;
+import org.apache.accumulo.core.metadata.schema.TabletMetadata.ColumnType;
+import org.apache.accumulo.core.metadata.schema.TabletsMetadata;
+import org.apache.accumulo.server.ServerContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class Upgrader11to12 implements Upgrader {
+
+  private static final Logger LOG = LoggerFactory.getLogger(Upgrader11to12.class);
+
+  @Override
+  public void upgradeZookeeper(ServerContext context) {
+    LOG.info("upgrade root - skipping, nothing to do");
+  }
+
+  @Override
+  public void upgradeRoot(ServerContext context) {
+    LOG.info("upgrade root - skipping, nothing to do");
+  }
+
+  @Override
+  public void upgradeMetadata(ServerContext context) {
+    LOG.info("upgrade metadata entries");
+    addHostingGoalToRootTable(context);
+    addHostingGoalToMetadataTable(context);
+    addHostingGoalToUserTables(context);
+  }

Review Comment:
   Thanks @keith-turner , that makes sense. Implemented in 911fe12.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [accumulo] dlmarion merged pull request #3322: Upgrader for version 4.0.0, set hosting goals on existing tablets

Posted by "dlmarion (via GitHub)" <gi...@apache.org>.
dlmarion merged PR #3322:
URL: https://github.com/apache/accumulo/pull/3322


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [accumulo] EdColeman commented on a diff in pull request #3322: Upgrader for version 4.0.0, set hosting goals on existing tablets

Posted by "EdColeman (via GitHub)" <gi...@apache.org>.
EdColeman commented on code in PR #3322:
URL: https://github.com/apache/accumulo/pull/3322#discussion_r1173796533


##########
server/base/src/test/java/org/apache/accumulo/server/ServerContextTest.java:
##########
@@ -18,6 +18,7 @@
  */
 package org.apache.accumulo.server;
 
+import static org.apache.accumulo.server.AccumuloDataVersion.REMOVE_DEPRECATIONS_FOR_VERSION_3;

Review Comment:
   it looks like this is unused



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [accumulo] EdColeman commented on a diff in pull request #3322: Upgrader for version 4.0.0, set hosting goals on existing tablets

Posted by "EdColeman (via GitHub)" <gi...@apache.org>.
EdColeman commented on code in PR #3322:
URL: https://github.com/apache/accumulo/pull/3322#discussion_r1173811131


##########
server/manager/src/main/java/org/apache/accumulo/manager/upgrade/Upgrader11to12.java:
##########
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.accumulo.manager.upgrade;
+
+import org.apache.accumulo.core.client.admin.TabletHostingGoal;
+import org.apache.accumulo.core.data.TableId;
+import org.apache.accumulo.core.metadata.MetadataTable;
+import org.apache.accumulo.core.metadata.RootTable;
+import org.apache.accumulo.core.metadata.schema.Ample.DataLevel;
+import org.apache.accumulo.core.metadata.schema.Ample.TabletsMutator;
+import org.apache.accumulo.core.metadata.schema.TabletMetadata.ColumnType;
+import org.apache.accumulo.core.metadata.schema.TabletsMetadata;
+import org.apache.accumulo.server.ServerContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class Upgrader11to12 implements Upgrader {
+
+  private static final Logger LOG = LoggerFactory.getLogger(Upgrader11to12.class);
+
+  @Override
+  public void upgradeZookeeper(ServerContext context) {
+    LOG.info("setting root table stored hosting goal");
+    addHostingGoalToRootTable(context);
+  }
+
+  @Override
+  public void upgradeRoot(ServerContext context) {
+    LOG.info("setting metadata table hosting goal");
+    addHostingGoalToMetadataTable(context);
+  }
+
+  @Override
+  public void upgradeMetadata(ServerContext context) {
+    LOG.info("setting hosting goal on user tables");
+    addHostingGoalToUserTables(context);
+  }
+
+  private void addHostingGoalToSystemTable(ServerContext context, TableId tableId) {
+    TabletsMetadata tm =

Review Comment:
   TabletMetadata - should be wrapped in try-with-resources (two places in this file)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [accumulo] dlmarion commented on pull request #3322: Upgrader for version 4.0.0, set hosting goals on existing tablets

Posted by "dlmarion (via GitHub)" <gi...@apache.org>.
dlmarion commented on PR #3322:
URL: https://github.com/apache/accumulo/pull/3322#issuecomment-1515130490

   @EdColeman - this seems pretty straightforward, would be interested in your thoughts on a test.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [accumulo] keith-turner commented on a diff in pull request #3322: Upgrader for version 4.0.0, set hosting goals on existing tablets

Posted by "keith-turner (via GitHub)" <gi...@apache.org>.
keith-turner commented on code in PR #3322:
URL: https://github.com/apache/accumulo/pull/3322#discussion_r1172644728


##########
server/manager/src/main/java/org/apache/accumulo/manager/upgrade/Upgrader11to12.java:
##########
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.accumulo.manager.upgrade;
+
+import org.apache.accumulo.core.client.admin.TabletHostingGoal;
+import org.apache.accumulo.core.data.TableId;
+import org.apache.accumulo.core.metadata.MetadataTable;
+import org.apache.accumulo.core.metadata.RootTable;
+import org.apache.accumulo.core.metadata.schema.Ample.DataLevel;
+import org.apache.accumulo.core.metadata.schema.Ample.TabletsMutator;
+import org.apache.accumulo.core.metadata.schema.TabletMetadata.ColumnType;
+import org.apache.accumulo.core.metadata.schema.TabletsMetadata;
+import org.apache.accumulo.server.ServerContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class Upgrader11to12 implements Upgrader {
+
+  private static final Logger LOG = LoggerFactory.getLogger(Upgrader11to12.class);
+
+  @Override
+  public void upgradeZookeeper(ServerContext context) {
+    LOG.info("upgrade root - skipping, nothing to do");
+  }
+
+  @Override
+  public void upgradeRoot(ServerContext context) {
+    LOG.info("upgrade root - skipping, nothing to do");
+  }
+
+  @Override
+  public void upgradeMetadata(ServerContext context) {
+    LOG.info("upgrade metadata entries");
+    addHostingGoalToRootTable(context);
+    addHostingGoalToMetadataTable(context);
+    addHostingGoalToUserTables(context);
+  }

Review Comment:
   Think the following will upgrade the root tablet metadata before it loaded and the metadata table metadata before its tablets are loaded
   
   ```suggestion
     @Override
     public void upgradeZookeeper(ServerContext context) {
       LOG.info("upgrading metadata stored in zookeeper");
       addHostingGoalToRootTable(context);
     }
   
     @Override
     public void upgradeRoot(ServerContext context) {
       LOG.info("upgrading metadata stored in the root table");
       addHostingGoalToMetadataTable(context);
     }
   
     @Override
     public void upgradeMetadata(ServerContext context) {
       LOG.info("upgrade metadata stored in metadata table");
       addHostingGoalToUserTables(context);
     }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org