Repository navigation
IGNITE-29177 Analyze and test the reliability of MDC historical rebalance mechanism - #13714
EgorBaranovEnjoysTyping wants to merge 4 commits into
Conversation
|
|
||
| . A full rebalance is used if the node has no local data for the partition (update counter is zero). | ||
| + | ||
| This applies both to a *new node joining for the first time* (it has no data on disk at all) and to a node that was *evicted from the baseline* and rejoined (its local partition data was invalidated). In both cases the full partition content must be downloaded from another node. |
There was a problem hiding this comment.
| This applies both to a *new node joining for the first time* (it has no data on disk at all) and to a node that was *evicted from the baseline* and rejoined (its local partition data was invalidated). In both cases the full partition content must be downloaded from another node. | |
| This applies both to a *new node joining for the first time* (it has no data on disk at all) and to a node that was *removed from the baseline* and than added back (its local partition data was invalidated). In both cases the full partition content must be downloaded from another node. |
There was a problem hiding this comment.
"Evicted" is the precise term in Ignite (cf. evictFromTopology). Also note the typo n the suggestion: "than" → "then".
| In clusters with persistence, the baseline topology has to be changed manually (default behavior), or can be changed automatically when link:clustering/baseline-topology#baseline-topology-autoadjustment[automatic baseline adjustment] is enabled. | ||
| ==== | ||
|
|
||
| == Rebalance Strategy [[rebalance-strategy]] |
There was a problem hiding this comment.
| == Rebalance Strategy [[rebalance-strategy]] | |
| == Rebalancing Strategy [[rebalance-strategy]] |
There was a problem hiding this comment.
Done
| + | ||
| Example: a partition contains 100 entries. While the node was absent, 500 writes hit this partition. Downloading 500 delta entries is more expensive than just downloading all 100 entries → full rebalance. | ||
|
|
||
| . A full rebalance is used if the partition size is below the `historical.rebalance.threshold` (DMS property, default 500 entries), unless the `IGNITE_PREFER_WAL_REBALANCE` system property is set to `true`. |
There was a problem hiding this comment.
| . A full rebalance is used if the partition size is below the `historical.rebalance.threshold` (DMS property, default 500 entries), unless the `IGNITE_PREFER_WAL_REBALANCE` system property is set to `true`. | |
| . A full rebalance is used if the partition size is below the `historical.rebalance.threshold` (a property stored in Distributed MetaStorage, default 500 entries), unless the `IGNITE_PREFER_WAL_REBALANCE` system property is set to `true`. |
There was a problem hiding this comment.
It's the standard abbreviation used throughout the codebase (DistributedMetaStorage,
GridDistributedMetastorageManager). Expanding it to "Distributed MetaStorage" (two words) would actually be incorrect — the canonical name is
"Distributed Meta Storage" (three words).
|
|
||
| [NOTE] | ||
| ==== | ||
| If both nodes report the same update counter for a partition, no rebalance is performed for that partition. |
There was a problem hiding this comment.
| If both nodes report the same update counter for a partition, no rebalance is performed for that partition. | |
| If both nodes report the same update counter for a partition, rebalance doesn't start for that partition. |
There was a problem hiding this comment.
The formal phrasing is preferred in documentation, and "performed" is more precise than "start"
(nothing starts, it simply doesn't happen).
|
|
||
| [NOTE] | ||
| ==== | ||
| *Historical rebalance requires the delta to be present in the WAL of the source node.* If the WAL segments that contain the delta were already archived or deleted by the time the node rejoins — for example, the node was absent for a long time, or WAL history and archiving are configured with a small retention — the source node cannot read the delta. In that case Ignite does not lose data: the supplier detects the failure to iterate over the WAL, marks the last checkpoint as not applicable for WAL rebalance, marks the affected partitions as missed, and the node falls back to a *full rebalance*. |
There was a problem hiding this comment.
| *Historical rebalance requires the delta to be present in the WAL of the source node.* If the WAL segments that contain the delta were already archived or deleted by the time the node rejoins — for example, the node was absent for a long time, or WAL history and archiving are configured with a small retention — the source node cannot read the delta. In that case Ignite does not lose data: the supplier detects the failure to iterate over the WAL, marks the last checkpoint as not applicable for WAL rebalance, marks the affected partitions as missed, and the node falls back to a *full rebalance*. | |
| *Historical rebalance requires the delta to be present in the WAL of the source node.* If the WAL segments that contain the delta were already archived or deleted by the time node lagged behind rejoins — for example, the node was absent for a long time, or WAL history and archiving are configured with a small retention — the source node cannot supply the delta. In that case Ignite does not lose data: the supplier detects the failure to iterate over the WAL, marks the last checkpoint as not applicable for WAL rebalance, marks the affected partitions as missed, and the node falls back to a *full rebalance*. |
There was a problem hiding this comment.
keeping the original ("the node rejoins"); the context already makes it clear which node and that it was
behind. "cannot supply the delta" — done.
| The `rebalanceDelay` (deprecated) setting also prevents a historical rebalance: when a delay is configured, the rebalance is scheduled outside of the partition map exchange context, and the historical path (which is tied to that context) is never taken — every partition is restored with a full rebalance regardless of the delta size and regardless of `IGNITE_PREFER_WAL_REBALANCE`. | ||
| ==== | ||
|
|
||
| In a link:clustering/multi-data-center[multi-data-center] setup, the preloader prefers a node from the same data center that holds a copy of the partition. If no such node is available, it falls back to a node from a remote data center. This behavior applies to both full and historical rebalance. |
There was a problem hiding this comment.
| In a link:clustering/multi-data-center[multi-data-center] setup, the preloader prefers a node from the same data center that holds a copy of the partition. If no such node is available, it falls back to a node from a remote data center. This behavior applies to both full and historical rebalance. | |
| In a link:clustering/multi-data-center[multi-data-center] setup, the node demanding the data prefers a node from the same data center that holds a copy of the partition. If no such node is available, it falls back to a node from a remote data center. This behavior applies to both full and historical rebalance. |
There was a problem hiding this comment.
"Preloader" is the actual component name in the codebase (GridDhtPreloader). The node doesn't "prefer"
anything; the preloader mechanism does.
| public void testHistoricalRebalanceCrossDC() throws Exception { | ||
| checkHistoricalRebalance(true); | ||
| } | ||
|
|
||
| /** | ||
| * Verifies that no rebalance demand is sent when a node restarts without any |
There was a problem hiding this comment.
| * Verifies that no rebalance demand is sent when a node restarts without any | |
| * Verifies that no rebalance request is sent when a node restarts without any |
There was a problem hiding this comment.
This is the protocol-level term used throughout the codebase (GridDhtPartitionDemandMessage) and in
the documentation itself.
There was a problem hiding this comment.
A lot of duplicated code shared between tests: start few nodes, activate nodes, create cache config, create cache, populate cache. Is it possible to extract at least some of these scenarios into separate methods?
There was a problem hiding this comment.
Done
…ance mechanism
Thank you for submitting the pull request to the Apache Ignite.
In order to streamline the review of the contribution
we ask you to ensure the following steps have been taken:
The Contribution Checklist
The description explains WHAT and WHY was made instead of HOW.
The following pattern must be used:
IGNITE-XXXX Change summarywhereXXXX- number of JIRA issue.(see the Maintainers list)
the
green visaattached to the JIRA ticket (see tabPR Checkat TC.Bot - Instance 1 or TC.Bot - Instance 2)Notes
If you need any help, please email dev@ignite.apache.org or ask any advice on https://the-asf.slack.com #ignite channel.