Uploaded image for project: 'Sentry'
  1. Sentry
  2. SENTRY-1931

NameNode only gets full snapshot once

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0
    • Fix Version/s: 2.0.0
    • Component/s: Sentry
    • Labels:
      None

      Description

      SENTRY-1815 introduced the notion of ImageID, but it turns out that it doesn't work quite as expected.

      The problem is that when we send partial update the image number isn't set:

        public List<PathsUpdate> retrieveDelta(long seqNum) throws Exception {
            ...
            List<PathsUpdate> updates = new ArrayList<>(mSentryPathChanges.size());
            for (MSentryPathChange mSentryPathChange : mSentryPathChanges) {
              // Gets the changeID from the persisted MSentryPathChange.
              long changeID = mSentryPathChange.getChangeID();
              // Creates a corresponding PathsUpdate and deserialize the
              // persisted delta update in JSON format to TPathsUpdate with
              // associated changeID.
              PathsUpdate pathsUpdate = new PathsUpdate();
              pathsUpdate.JSONDeserialize(mSentryPathChange.getPathChange());
              pathsUpdate.setSeqNum(changeID);
              updates.add(pathsUpdate);
            }
            return updates;
          }
        }
      

      When it isn't set, thrift uses -1 as the default (as specified in our Thrift file).

      The code in UpdateableAuthzPaths.updatePartial does this:

        @Override
        public void updatePartial(Iterable<PathsUpdate> updates, ReadWriteLock lock) {
            for (PathsUpdate update : updates) {
              applyPartialUpdate(update);
              seqNum.set(update.getSeqNum());
              imgNum.set(update.getImgNum()); // Here
            }
        }
      

      so we set imgNum to -1 when we receive any partial update and then we always request for all updates from -1 and never receive a full update.

        Attachments

        1. SENTRY-1931.1.patch
          11 kB
          Sergio Peña

          Issue Links

            Activity

              People

              • Assignee:
                spena Sergio Peña
                Reporter:
                akolb Alex Kolbasov
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: