nizhikov commented on code in PR #10314: URL: https://github.com/apache/ignite/pull/10314#discussion_r1027655716
########## modules/core/src/main/java/org/apache/ignite/internal/processors/cache/consistentcut/ConsistentCutManager.java: ########## @@ -0,0 +1,212 @@ +/* + * 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.consistentcut; + +import java.util.UUID; +import java.util.concurrent.atomic.AtomicReferenceFieldUpdater; +import org.apache.ignite.IgniteCheckedException; +import org.apache.ignite.internal.pagemem.wal.record.ConsistentCutFinishRecord; +import org.apache.ignite.internal.pagemem.wal.record.ConsistentCutStartRecord; +import org.apache.ignite.internal.processors.cache.GridCacheMessage; +import org.apache.ignite.internal.processors.cache.GridCacheSharedManagerAdapter; +import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture; +import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.PartitionsExchangeAware; +import org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx; +import org.apache.ignite.internal.processors.cache.transactions.IgniteTxAdapter; +import org.apache.ignite.internal.util.typedef.internal.U; +import org.jetbrains.annotations.Nullable; + +import static org.apache.ignite.internal.processors.cache.GridCacheUtils.baselineNode; + +/** + * Processes all stuff related to Consistent Cut. + * <p> + * ConsistentCut is a distributed algorithm that splits WAL on 2 global areas - BEFORE and AFTER. It guarantees that every + * transaction committed Before also will be committed Before on every other node participated in the transaction. + * It means that an 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 {@link ConsistentCutAwareMessage}. + * <p> + * The algorithm consist of steps: + * 1. On receiving new Consistent Cut ID it immediately creates new {@link ConsistentCut} before processing the message. + * 2. It starts wrapping all transaction messages to {@link ConsistentCutAwareMessage}. + * 3. Every transaction holds {@link IgniteTxAdapter#cutId()} AFTER which it committed. Value of this field is defined + * at node that commits first in distributed transaction. + * 3. On baseline nodes: Review Comment: typo 3 -> 4 -- 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]
