nizhikov commented on code in PR #10314: URL: https://github.com/apache/ignite/pull/10314#discussion_r1066048347
########## modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/ConsistentCut.java: ########## @@ -0,0 +1,130 @@ +/* + * 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.processors.cache.persistence.snapshot; + +import java.util.UUID; +import org.apache.ignite.internal.IgniteInternalFuture; +import org.apache.ignite.internal.pagemem.wal.record.ConsistentCutFinishRecord; +import org.apache.ignite.internal.processors.cache.GridCacheMessage; +import org.apache.ignite.internal.processors.cache.GridCacheSharedContext; +import org.apache.ignite.internal.processors.cache.persistence.wal.WALPointer; +import org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx; +import org.apache.ignite.internal.util.future.GridCompoundIdentityFuture; +import org.apache.ignite.internal.util.future.GridFutureAdapter; +import org.jetbrains.annotations.Nullable; + +import static org.apache.ignite.internal.processors.cache.GridCacheUtils.baselineNode; + +/** + * Consistent Cut is a distributed algorithm that defines two set of transactions - BEFORE and AFTER cut - on baseline nodes. + * It guarantees that every transaction was included into BEFORE on one node also included into the BEFORE on every other node + * participated in the transaction. It means that Ignite nodes can safely recover themselves to the consistent BEFORE + * state without any coordination with each other. + * <p> + * The algorithm starts on Ignite node by snapshot creation command. Other nodes are notified with discovery message of snapshot + * distributed process or by transaction messages wrapped in {@link ConsistentCutAwareMessage}. + * <p> + * There are two roles that node can play: + * 1. Wraps outgoing transaction messages into {@link ConsistentCutAwareMessage}. For this role every node is responsible. + * 2. Writes Consistent Cut records into WAL. Only baseline nodes do it. + * <p> + * Nodes start wrapping messages from the moment Consistent Cut started on the node, and finsihed after all baseline + * nodes complete their role 2. + */ +public class ConsistentCut { Review Comment: With current implementation, purpose of this class is not clear. It seems we can simply move all the code to `IgniteSnapshotManager`. -- 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]
