[
https://issues.apache.org/jira/browse/IGNITE-18814?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Vladislav Pyatkov updated IGNITE-18814:
---------------------------------------
Description:
*Motivation*
{code:java}
MvPartitionStorage storage = listener.getMvStorage();
if (hash == 0) {
hash = storage.hashCode();
} else if (hash != storage.hashCode()) {
return false;
}{code}
This code is wrong, hash code is not defined for storage.
*Implementation notes*
To summarize all the mentioned before, the main issue is finding a way to
compare data stored in different replicas.
The obvious approach to calculate hash all object that stored in each replica
storage. But the implementation can be difficult and time expensive in the test.
The easy way to compare stored indexies ( _MvPartitionStorage#lastAppliedIndex_
, _MvPartitionStorage#persistedIndex_). The both are applicable for comparison,
but _persistedIndex_ upgrades latter.
{code}
MvPartitionStorage storage = listener.getMvStorage();
if (idx == 0) {
idx = storage.persistedIndex();
} else if (idx != storage.persistedIndex()) {
return false;
}
{code}
was:
{code:java}
MvPartitionStorage storage = listener.getMvStorage();
if (hash == 0) {
hash = storage.hashCode();
} else if (hash != storage.hashCode()) {
return false;
}{code}
This code is wrong, hash code is not defined for storage.
To summarize all the mentioned before, the main issue is finding a way to
compare data stored in different replicas.
The obvious approach to calculate hash all object that stored in each replica
storage. But the implementation can be difficult and time expensive in the test.
The easy way to compare stored indexies ( _MvPartitionStorage#lastAppliedIndex_
, _MvPartitionStorage#persistedIndex_). The both are applicable for comparison,
but _persistedIndex_ upgrades latter.
{code}
MvPartitionStorage storage = listener.getMvStorage();
if (idx == 0) {
idx = storage.persistedIndex();
} else if (idx != storage.persistedIndex()) {
return false;
}
{code}
> Fix ItTxDistributedTestSingleNode#assertPartitionsSame
> ------------------------------------------------------
>
> Key: IGNITE-18814
> URL: https://issues.apache.org/jira/browse/IGNITE-18814
> Project: Ignite
> Issue Type: Bug
> Reporter: Ivan Bessonov
> Priority: Critical
> Labels: ignite-3
>
> *Motivation*
> {code:java}
> MvPartitionStorage storage = listener.getMvStorage();
> if (hash == 0) {
> hash = storage.hashCode();
> } else if (hash != storage.hashCode()) {
> return false;
> }{code}
> This code is wrong, hash code is not defined for storage.
> *Implementation notes*
> To summarize all the mentioned before, the main issue is finding a way to
> compare data stored in different replicas.
> The obvious approach to calculate hash all object that stored in each replica
> storage. But the implementation can be difficult and time expensive in the
> test.
> The easy way to compare stored indexies (
> _MvPartitionStorage#lastAppliedIndex_ , _MvPartitionStorage#persistedIndex_).
> The both are applicable for comparison, but _persistedIndex_ upgrades latter.
> {code}
> MvPartitionStorage storage = listener.getMvStorage();
> if (idx == 0) {
> idx = storage.persistedIndex();
> } else if (idx != storage.persistedIndex()) {
> return false;
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)