[
https://issues.apache.org/jira/browse/IGNITE-7831?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16386105#comment-16386105
]
Ilya Lantukh commented on IGNITE-7831:
--------------------------------------
[~alex_pl], problems that I encountered and that I'd like to see fixed and
removed include those you discovered. Making assertions based on ability to
create directory and throwing explicit AssertionErrors when WAL doesn't have
enough data to restore page are things that should be fixed.
One of real cases that I encountered quite recently is method
GridCacheOffheapManager.GridCacheDataStore.getOrAllocatePartitionMetas():
{noformat}
else {
PagePartitionMetaIO io = PageIO.getPageIO(pageAddr);
treeRoot = io.getTreeRoot(pageAddr);
reuseListRoot = io.getReuseListRoot(pageAddr);
assert PageIdUtils.flag(treeRoot) == PageMemory.FLAG_DATA :
U.hexLong(treeRoot) + ", part=" + partId + ", grpId=" + grpId;
assert PageIdUtils.flag(reuseListRoot) == PageMemory.FLAG_DATA :
U.hexLong(reuseListRoot) + ", part=" + partId + ", grpId=" + grpId;
}
{noformat}
Ideally, I'd like to ensure that all assertions for reading data from memory
pages are properly handled and lead to node invalidation
(NodeInvalidator.invalidate(...)). Replacing those "assert"s with "throw"s
might be inconvenient and make code less readable, but making sure that they
are caught, processed and re-thrown will be beneficial.
> Throw Exceptions instead of AssertionErrors when reading from corrupted
> persistence
> -----------------------------------------------------------------------------------
>
> Key: IGNITE-7831
> URL: https://issues.apache.org/jira/browse/IGNITE-7831
> Project: Ignite
> Issue Type: Improvement
> Reporter: Ilya Lantukh
> Assignee: Aleksey Plekhanov
> Priority: Major
> Labels: iep-14
> Fix For: 2.5
>
>
> There are a few places in our code where we explicitly throw AssertionErrors
> due to inability to correctly read data from persistence and many more places
> where we make assertions based on read values.
> Assertions are used to indicate problems in internal logic, while persistence
> might also get corrupted by various external reasons. It also makes uniform
> handling of such issues considerably harder, because exception handling logic
> in Ignite ignores Errors. If we want to improve stability and minimize
> consequenses of pesistence corruption, we should replace all those
> AssertionErrors and asserts with Exceptions, so that current exception
> handling mechanisms could be reduce. In a number of situations it means that
> instead of causing cluster-wide hang-up problematic node will be
> automatically killed.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)