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

NameNode only gets full snapshot once

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0.0
    • 2.0.0
    • Sentry
    • 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

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

              Dates

                Created:
                Updated:
                Resolved:

                Slack

                  Issue deployment