Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-21482

Fix of initialization of the last version in GridCacheVersionManager

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      GridCacheVersionManager has wierd initialization of its last version:

      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);
              ...
          }
      

      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.

      We should revise the initialization code. The assumed fix is:

      last = new GridCacheVersion((int)topVer + offset, order.get(), (int)cctx.localNode().order(), dataCenterId);
      

      Or we should remove this last version at all. Looks like we need only the order.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              vladsz83 Vladimir Steshin
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m