You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "keith-turner (via GitHub)" <gi...@apache.org> on 2024/01/20 01:47:41 UTC
[PR] WIP moves finding split points into FATE [accumulo]
keith-turner opened a new pull request, #4178:
URL: https://github.com/apache/accumulo/pull/4178
1. Moves finding split points from tablet from a custom thread pool in the manager into FATE. This is done by the new Repo named FindSplits.
2. Stops tracking what splits are running in manager memory and moves this into FATE. This is not implemented yet, plan to do that in another PR
3. Stops tracking what tablets are unsplittable in manager memory. This should be tracked in metadata table per #4177. This change can be in its own commit. In this commit the in memory tracking is simply removed.
These changes will reduce manager memory usage. These changes also will make splitting tablets work much better if FATE is distributed for two reasons. First it allows the computation to spread over multiple manager processes. Second it allows tracking of what is splitting to move from memory to persisted storage and not rely on a map in a single process.
This is a WIP commit because it requires FATE changes. The needed FATE changes were stubbed out in this PR and implemented with a in memory set that would need to be persisted.
--
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
Re: [PR] moves finding split points into FATE [accumulo]
Posted by "keith-turner (via GitHub)" <gi...@apache.org>.
keith-turner commented on code in PR #4178:
URL: https://github.com/apache/accumulo/pull/4178#discussion_r1498389754
##########
server/manager/src/main/java/org/apache/accumulo/manager/tableOps/split/FindSplits.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.tableOps.split;
+
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+import org.apache.accumulo.core.dataImpl.KeyExtent;
+import org.apache.accumulo.core.fate.FateId;
+import org.apache.accumulo.core.fate.Repo;
+import org.apache.accumulo.manager.Manager;
+import org.apache.accumulo.manager.split.SplitUtils;
+import org.apache.accumulo.manager.tableOps.ManagerRepo;
+import org.apache.hadoop.io.Text;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class FindSplits extends ManagerRepo {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final Logger log = LoggerFactory.getLogger(PreSplit.class);
+ private final SplitInfo splitInfo;
+
+ public FindSplits(KeyExtent extent) {
+ this.splitInfo = new SplitInfo(extent, new TreeSet<>());
+ }
+
+ @Override
+ public Repo<Manager> call(FateId fateId, Manager manager) throws Exception {
+ var extent = splitInfo.getOriginal();
+ var tabletMetadata = manager.getContext().getAmple().readTablet(extent);
+
+ if (tabletMetadata == null) {
+ log.trace("Table {} no longer exist, so not gonna try to find a split point for it", extent);
+ return null;
+ }
+
+ if (tabletMetadata.getOperationId() != null) {
+ log.debug("Not splitting {} because it has operation id {}", tabletMetadata.getExtent(),
+ tabletMetadata.getOperationId());
+ return null;
+ }
+
Review Comment:
checked in 0f1f2fa
--
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
Re: [PR] moves finding split points into FATE [accumulo]
Posted by "keith-turner (via GitHub)" <gi...@apache.org>.
keith-turner commented on code in PR #4178:
URL: https://github.com/apache/accumulo/pull/4178#discussion_r1498390132
##########
server/manager/src/main/java/org/apache/accumulo/manager/split/Splitter.java:
##########
@@ -84,52 +74,34 @@ public int hashCode() {
LoadingCache<CacheKey,FileInfo> splitFileCache;
- public static int weigh(KeyExtent keyExtent) {
- int size = 0;
- size += keyExtent.tableId().toString().length();
- if (keyExtent.endRow() != null) {
- size += keyExtent.endRow().getLength();
- }
- if (keyExtent.prevEndRow() != null) {
- size += keyExtent.prevEndRow().getLength();
- }
- return size;
- }
-
public Splitter(ServerContext context) {
- this.splitExecutor = context.threadPools().createExecutorService(context.getConfiguration(),
- Property.MANAGER_SPLIT_WORKER_THREADS, true);
+ int numThreads = context.getConfiguration().getCount(Property.MANAGER_SPLIT_WORKER_THREADS);
+ // Set up thread pool that constrains the amount of task it queues and when full discards task.
+ // The purpose of this is to avoid reading lots of data into memory if lots of tablets need to
+ // split.
+ BlockingQueue<Runnable> queue = new ArrayBlockingQueue<>(10000);
+ this.splitExecutor = context.threadPools().createThreadPool(numThreads, numThreads, 0,
Review Comment:
removed 0f1f2fa
--
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
Re: [PR] moves finding split points into FATE [accumulo]
Posted by "keith-turner (via GitHub)" <gi...@apache.org>.
keith-turner merged PR #4178:
URL: https://github.com/apache/accumulo/pull/4178
--
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
Re: [PR] moves finding split points into FATE [accumulo]
Posted by "dlmarion (via GitHub)" <gi...@apache.org>.
dlmarion commented on code in PR #4178:
URL: https://github.com/apache/accumulo/pull/4178#discussion_r1496483716
##########
server/manager/src/main/java/org/apache/accumulo/manager/tableOps/split/FindSplits.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.tableOps.split;
+
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+import org.apache.accumulo.core.dataImpl.KeyExtent;
+import org.apache.accumulo.core.fate.FateId;
+import org.apache.accumulo.core.fate.Repo;
+import org.apache.accumulo.manager.Manager;
+import org.apache.accumulo.manager.split.SplitUtils;
+import org.apache.accumulo.manager.tableOps.ManagerRepo;
+import org.apache.hadoop.io.Text;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class FindSplits extends ManagerRepo {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final Logger log = LoggerFactory.getLogger(PreSplit.class);
+ private final SplitInfo splitInfo;
+
+ public FindSplits(KeyExtent extent) {
+ this.splitInfo = new SplitInfo(extent, new TreeSet<>());
+ }
+
+ @Override
+ public Repo<Manager> call(FateId fateId, Manager manager) throws Exception {
+ var extent = splitInfo.getOriginal();
+ var tabletMetadata = manager.getContext().getAmple().readTablet(extent);
+
+ if (tabletMetadata == null) {
+ log.trace("Table {} no longer exist, so not gonna try to find a split point for it", extent);
+ return null;
+ }
+
+ if (tabletMetadata.getOperationId() != null) {
+ log.debug("Not splitting {} because it has operation id {}", tabletMetadata.getExtent(),
+ tabletMetadata.getOperationId());
+ return null;
+ }
+
Review Comment:
Do we need to add a check for walogs?
##########
server/manager/src/main/java/org/apache/accumulo/manager/split/Splitter.java:
##########
@@ -84,52 +74,34 @@ public int hashCode() {
LoadingCache<CacheKey,FileInfo> splitFileCache;
- public static int weigh(KeyExtent keyExtent) {
- int size = 0;
- size += keyExtent.tableId().toString().length();
- if (keyExtent.endRow() != null) {
- size += keyExtent.endRow().getLength();
- }
- if (keyExtent.prevEndRow() != null) {
- size += keyExtent.prevEndRow().getLength();
- }
- return size;
- }
-
public Splitter(ServerContext context) {
- this.splitExecutor = context.threadPools().createExecutorService(context.getConfiguration(),
- Property.MANAGER_SPLIT_WORKER_THREADS, true);
+ int numThreads = context.getConfiguration().getCount(Property.MANAGER_SPLIT_WORKER_THREADS);
+ // Set up thread pool that constrains the amount of task it queues and when full discards task.
+ // The purpose of this is to avoid reading lots of data into memory if lots of tablets need to
+ // split.
+ BlockingQueue<Runnable> queue = new ArrayBlockingQueue<>(10000);
+ this.splitExecutor = context.threadPools().createThreadPool(numThreads, numThreads, 0,
Review Comment:
You could remove the branch in ThreadPools.createExecutorService that handles the property MANAGER_SPLIT_WORKER_THREADS.
--
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