[
https://issues.apache.org/jira/browse/IGNITE-21482?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17815592#comment-17815592
]
Ignite TC Bot commented on IGNITE-21482:
----------------------------------------
{panel:title=Branch: [pull/11237/head] Base: [master] : No blockers
found!|borderStyle=dashed|borderColor=#ccc|titleBGColor=#D6F7C1}{panel}
{panel:title=Branch: [pull/11237/head] Base: [master] : No new tests
found!|borderStyle=dashed|borderColor=#ccc|titleBGColor=#F7D6C1}{panel}
[TeamCity *--> Run :: All*
Results|https://ci2.ignite.apache.org/viewLog.html?buildId=7737356&buildTypeId=IgniteTests24Java8_RunAll]
> Fix of initialization of the last version in GridCacheVersionManager
> --------------------------------------------------------------------
>
> Key: IGNITE-21482
> URL: https://issues.apache.org/jira/browse/IGNITE-21482
> Project: Ignite
> Issue Type: Improvement
> Reporter: Vladimir Steshin
> Priority: Minor
> Time Spent: 10m
> Remaining Estimate: 0h
>
> GridCacheVersionManager has wierd initialization of its _last_ version:
> {code:java}
> public void onLocalJoin(long topVer) {
> long startTime = cctx.kernalContext().discovery().gridStartTime();
> if (startTime != 0)
> offset = (int)((startTime - TOP_VER_BASE_TIME) / 1000);
> last = new GridCacheVersion(0, order.get(), 0, dataCenterId);
> ...
> }
> {code}
> _topVer_, _nodeOrder_ and _offset_ are ignored. While _GridCacheVersion_ says
> '_topVer Topology version plus number of seconds from the start time of the
> first grid node._'. If this 'zeroed' value is read before any CRUD, a
> following comparation of the versions may fail. This happened in
> [IGNITE-21236|https://issues.apache.org/jira/browse/IGNITE-21236].
> We should revise the initialization code. The assumed fix is:
> {code:java}
> last = new GridCacheVersion((int)topVer + offset, order.get(),
> (int)cctx.localNode().order(), dataCenterId);
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)