blob: 9aef810ce0a4ec5684635b5c268b4623fd4c47ab [file] [log] [blame]
<!--
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.
-->
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-1382082-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-61232409-1');
</script>
<meta charset="UTF-8">
<title>Topology Validator | Ignite Documentation</title>
<link rel="canonical" href="/docs/topology-validator/topology-validator" />
<link rel="stylesheet" href="/assets/css/styles.css?1658382976">
<link rel="stylesheet" href="/assets/css/asciidoc-pygments.css">
<link rel="shortcut icon" href="/favicon.ico">
<meta name='viewport' content='width=device-width, height=device-height, initial-scale=1.0, minimum-scale=1.0'>
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="/assets/js/jquery.swiftype.autocomplete.js?1658382976"></script>
<script type="text/javascript" src="/assets/js/anchor.min.js?1658382976"></script>
</head>
<body>
<!--
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.
-->
<!--header>
<button type='button' class='menu' title='Docs menu'>
<img src="/assets/images/menu-icon.svg"/>
</button>
<nav>
</nav>
<form class='search'>
<button class="search-close" type='button'><img src='/assets/images/cancel.svg'></button>
<input type="search" placeholder="Search…" id="search-input">
</form>
<button type='button' class='search-toggle'><img src='/assets/images/search.svg'></button>
<button type='button' class='top-nav-toggle'>⋮</button>
<a href="https://github.com/ignite" title='GitHub' class='github' target="_blank">
<img src="/assets/images/github-gray.svg" alt="GitHub logo">
</a>
</header-->
<!--
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.
-->
<link rel="stylesheet" href="/assets/css/docs.css">
<section class='page-docs'>
<!--
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.
-->
<nav class='left-nav' data-swiftype-index='false'>
<li>
<a href="/docs/extensions/aws/aws" class=''>Amazon S3 IP Finder</a>
</li>
<li>
<a href="/docs/extensions/camel/camel-streamer" class=''>Apache Camel Streamer</a>
</li>
<li>
<a href="/docs/extensions/flink/flink-streamer" class=''>Apache Flink Streamer</a>
</li>
<li>
<a href="/docs/extensions/flume/flume-sink" class=''>Apache Flume Sink</a>
</li>
<li>
<a href="/docs/extensions/azure/azure" class=''>Apache Ignite Azure Module</a>
</li>
<li>
<a href="/docs/extensions/gce/gce" class=''>Apache Ignite GCE Module</a>
</li>
<li>
<a href="/docs/extensions/pub-sub/pub-sub" class=''>Apache Ignite Pub/Sub Module</a>
</li>
<li>
<a href="/docs/extensions/spring/spring-boot" class=''>Apache Ignite and Spring Boot</a>
</li>
<li>
<a href="/docs/extensions/spring/spring-data" class=''>Apache Ignite and Spring Data</a>
</li>
<li>
<a href="/docs/extensions/spring/spring-caching" class=''>Apache Ignite and Spring Cache</a>
</li>
<li>
<a href="/docs/extensions/spring/spring-sessions" class=''>Apache Ignite and Spring Session</a>
</li>
<li>
<a href="/docs/extensions/spring/spring-tx" class=''>Apache Ignite and Spring Transactions</a>
</li>
<li>
<a href="/docs/extensions/kafka/kafka-streamer" class=''>Apache Kafka Streamer</a>
</li>
<li>
<a href="/docs/extensions/storm/storm-streamer" class=''>Apache Storm Streamer</a>
</li>
<li>
<a href="/docs/extensions/cdc/change-data-capture-extensions" class=''>Change Data Capture Extension</a>
</li>
<li>
<a href="/docs/extensions/jms/jms-streamer" class=''>JMS Streamer</a>
</li>
<li>
<a href="/docs/extensions/mqtt/mqtt-streamer" class=''>MQTT Streamer</a>
</li>
<li>
<a href="/docs/extensions/perf-statistics/performance-statistics" class=''>Performance Statistics Extension</a>
</li>
<li>
<a href="/docs/extensions/rocketmq/rocketmq-streamer" class=''>RocketMQ Streamer</a>
</li>
<li>
<a href="/docs/extensions/topology-validator/topology-validator" class=''>Topology Validator</a>
</li>
<li>
<a href="/docs/extensions/twitter/twitter-streamer" class=''>Twitter Streamer</a>
</li>
<li>
<a href="/docs/extensions/zeromq/zeromq-streamer" class=''>ZeroMQ Streamer</a>
</li>
<li>
<a href="/docs/extensions/zookeeper/zookeeper-ip" class=''>ZooKeeper IP Finder</a>
</li>
</nav>
<div class="left-nav__overlay"></div>
<article data-swiftype-index='true'>
<a class='edit-link' href="/_docs/topology-validator/topology-validator.adoc" target="_blank">Edit</a>
<h1>Topology Validator</h1>
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>Some network issues can cause the Ignite cluster to split into several isolated parts - segments. Nodes from different
segments cannot communicate with each other, while nodes from the same segment do not experience communication problems.
In this case, each segment marks the nodes with which the connection was lost as failed and considers itself as an
independent Ignite cluster. Let&#8217;s call this scenario cluster segmentation.</p>
</div>
<div class="paragraph">
<p>Cluster segmentation can lead to cache data inconsistency across different segments because each segment can continue to handle cache update requests independently.</p>
</div>
<div class="paragraph">
<p>Apache Ignite allows the user to provide custom validation logic for Ignite caches that will be applied to
each topology change, and if the validation fails, writes to the corresponding cache will be blocked. The mentioned
validation logic is passed to Ignite as an TopologyValidation interface implementation. It can be done through cache
configuration or through Ignite plugin extensions mechanism (see CacheTopologyValidatorProvider interface).</p>
</div>
<div class="paragraph">
<p>This module represents an implementation of the Ignite plugin that provides the guarantee that
after cluster segmentation, no more than one segment can process write requests to all caches. This is achieved by
providing implementation of the TopologyValidation interface as mentioned above.</p>
</div>
<div class="paragraph">
<p>The current implementation of TopologyValidation uses remaining Ignite baseline nodes in the topology to determine
segmentation.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="in-what-cases-cache-writes-will-be-blocked-for-the-segment">In what cases cache writes will be blocked for the segment?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The following rules are used to determine which segment can process cache write requests after segmentation and which
cannot:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>The segment is allowed to process cache writes requests after segmentation if and only if more than configured
fraction of the baseline nodes remain in the segment, otherwise all writes to the cache will be blocked.</p>
</li>
<li>
<p>If the cluster is split into two equal segments, writing to both of them will be blocked.</p>
</li>
<li>
<p>Since Ignite treats segmentation as sequential node failures, even a single node failure in an active cluster in
which alive baseline nodes count is less or equals to segmentation threshold is considered as segmentation and results
in write block for all caches.</p>
</li>
</ol>
</div>
</div>
</div>
<div class="sect1">
<h2 id="configuration">Configuration</h2>
<div class="sectionbody">
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Configure CacheTopologyValidatorPluginProvider on each server node:</p>
<div class="listingblock">
<div class="content">
<pre> ```
new IgniteConfiguration()
...
.setPluginProviders(new CacheTopologyValidatorPluginProvider());
```</pre>
</div>
</div>
</li>
<li>
<p>Configure baseline nodes explicitly, or configure baseline nodes auto adjustment with a timeout that significantly
exceeds the node failure detection timeout. It can be done through Java Api or through control script.
See [1] and [2] for more info.</p>
</li>
</ol>
</div>
<div class="paragraph">
<p>Note that it is illegal to use baseline nodes auto adjustment with a zero timeout along with current
TopologyValidator implementation.</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Configure deactivation threshold.
The deactivation threshold is a fraction of nodes that determines how many nodes must remain in the baseline topology in
order to this segment was considered valid and continued to accept write requests.
This value must be in range from 0.5 (inclusively) to 1. Default value is 0.5. If the default value suits you, nothing
to do is required.</p>
</li>
</ol>
</div>
<div class="paragraph">
<p>To set up custom deactivation threshold value set the <code>org.apache.ignite.topology.validator.deactivation.threshold</code>
distributed configuration property via control script (see <a href="https://ignite.apache.org/docs/latest/tools/control-script#working-with-cluster-properties" class="bare">https://ignite.apache.org/docs/latest/tools/control-script#working-with-cluster-properties</a>)</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="manual-segmentation-resolving">Manual segmentation resolving</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The state of each segment for which cache writes were blocked will be eventually switched to the READ-ONLY mode.
Manually switching the cluster state back to ACTIVE mode will restore cache write availability. It can be done through
Java Api or through control script. See [1] and [2] for more info.</p>
</div>
<div class="paragraph">
<p>[1] - <a href="https://ignite.apache.org/docs/latest/clustering/baseline-topology" class="bare">https://ignite.apache.org/docs/latest/clustering/baseline-topology</a></p>
</div>
<div class="paragraph">
<p>[2] - <a href="https://ignite.apache.org/docs/latest/tools/control-script#activation-deactivation-and-topology-management" class="bare">https://ignite.apache.org/docs/latest/tools/control-script#activation-deactivation-and-topology-management</a></p>
</div>
</div>
</div>
<!--
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.
-->
<div class="copyright">
© 2022 The Apache Software Foundation.<br/>
Apache, Apache Ignite, the Apache feather and the Apache Ignite logo are either registered trademarks or trademarks of The Apache Software Foundation.
</div>
</article>
<!--
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.
-->
<nav class="right-nav" data-swiftype-index='false'>
<ul class="sectlevel1">
<li><a href="#in-what-cases-cache-writes-will-be-blocked-for-the-segment">In what cases cache writes will be blocked for the segment?</a></li>
<li><a href="#configuration">Configuration</a></li>
<li><a href="#manual-segmentation-resolving">Manual segmentation resolving</a></li>
</ul>
<!--
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.
-->
<footer>
</footer>
</nav>
</section>
<script type='module' src='/assets/js/code-copy-to-clipboard.js' async></script>
<script>
// inits deep anchors -- needs to be done here because of https://www.bryanbraun.com/anchorjs/#dont-run-it-too-late
anchors.add('.page-docs h1, .page-docs h2, .page-docs h3:not(.discrete), .page-docs h4, .page-docs h5');
anchors.options = {
placement: 'right',
visible: 'always'
};
</script>
</body>
<script type='module' src='/assets/js/index.js?1658382976' async></script>
</html>