keith-turner commented on code in PR #3232:
URL: https://github.com/apache/accumulo/pull/3232#discussion_r1143346453


##########
core/src/main/java/org/apache/accumulo/core/metadata/TabletOperation.java:
##########
@@ -0,0 +1,24 @@
+/*
+ * 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.core.metadata;
+
+// TODO where should this go, maybe in MetadataSchema class?
+public enum TabletOperation {
+  NONE, SPLITTING, MERGING, DELETING

Review Comment:
   The way this is used is in flux at the moment.  I created them at first 
thinking it would prevent a split and merge operation from running on the same 
tablet.  While working on it I realized that two concurrent splits operations 
also need to be prevented from running on the same tablet.  Like if two 
operations try to split the same tablet with different split points at the same 
time.  So the operation id column with a uuid was added to prevent this.  I 
think the operation id is all that is needed and the operation column that uses 
this enum could be dropped. 
   
   Also thinking of changing the column name from operation id to lock id.  
Split, merge, and delete operations need to prevent any changes from being made 
to the tablet.  So maybe lock is a better name for the column in the metadata 
table.  
   
   This lock column in the metadata table could have a structure like 
`lock=<manager id>:<operation type>:<operation uuid>`.  The operation uuid 
would identify the specific task that holds the lock and manager id would 
identify where its currently running. When a manger process dies, another will 
need to take over running the operation.  The operation type would be SPLIT, 
MERGE, or DELETE as those are the current operations that need exclusive tablet 
access.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to