sanpwc commented on code in PR #2877: URL: https://github.com/apache/ignite-3/pull/2877#discussion_r1413514755
########## modules/transactions/src/main/java/org/apache/ignite/internal/tx/impl/TxUnlockManager.java: ########## @@ -0,0 +1,322 @@ +/* + * 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 + * + * http://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.ignite.internal.tx.impl; + +import static java.util.concurrent.CompletableFuture.allOf; +import static java.util.concurrent.TimeUnit.SECONDS; +import static org.apache.ignite.internal.hlc.HybridTimestamp.hybridTimestampToLong; +import static org.apache.ignite.internal.util.ExceptionUtils.withCause; +import static org.apache.ignite.lang.ErrorGroups.Replicator.REPLICA_UNAVAILABLE_ERR; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.UUID; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; +import org.apache.ignite.internal.hlc.HybridClock; +import org.apache.ignite.internal.hlc.HybridTimestamp; +import org.apache.ignite.internal.logger.IgniteLogger; +import org.apache.ignite.internal.logger.Loggers; +import org.apache.ignite.internal.manager.IgniteComponent; +import org.apache.ignite.internal.placementdriver.PlacementDriver; +import org.apache.ignite.internal.placementdriver.ReplicaMeta; +import org.apache.ignite.internal.replicator.ReplicationGroupId; +import org.apache.ignite.internal.replicator.TablePartitionId; +import org.apache.ignite.internal.tx.LockManager; +import org.apache.ignite.internal.tx.TxManager; +import org.apache.ignite.internal.tx.impl.TxManagerImpl.TransactionFailureHandler; +import org.apache.ignite.internal.tx.message.LockReleaseMessage; +import org.apache.ignite.internal.tx.message.TxMessageGroup; +import org.apache.ignite.internal.tx.message.TxMessagesFactory; +import org.apache.ignite.network.ClusterService; +import org.apache.ignite.network.NetworkMessage; +import org.apache.ignite.tx.TransactionException; +import org.jetbrains.annotations.Nullable; + +/** + * Releases TX locks. + */ +public class TxUnlockManager implements IgniteComponent { Review Comment: Let me clarify my point. Having TxUnlock helper may be fine but - components dependency tree is confusing: e.g. TxManager propagates unlock call to TxUnlockManager while TxUnlockManager depends on TxManager itself. - TxUnlockManager is a first citizen (IgniteComponent). Why? - Having LockManager and special case TxUnloclManager is tricky. Let's discus it on our tx sync. -- 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]
