Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-15759

RegionObserver.preStoreScannerOpen() doesn't have acces to current readpoint

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 2.0.0
    • Coprocessors
    • Reviewed
    • Hide
      The following RegionObserver method is deprecated and would no longer be called in hbase 2.0:

        public KeyValueScanner preStoreScannerOpen(final ObserverContext<RegionCoprocessorEnvironment> c,
            final Store store, final Scan scan, final NavigableSet<byte[]> targetCols,
            final KeyValueScanner s) throws IOException {

      Instead, override this method:

        public KeyValueScanner preStoreScannerOpen(final ObserverContext<RegionCoprocessorEnvironment> c,
            final Store store, final Scan scan, final NavigableSet<byte[]> targetCols,
            final KeyValueScanner s, final long readPt) throws IOException {
      Show
      The following RegionObserver method is deprecated and would no longer be called in hbase 2.0:   public KeyValueScanner preStoreScannerOpen(final ObserverContext<RegionCoprocessorEnvironment> c,       final Store store, final Scan scan, final NavigableSet<byte[]> targetCols,       final KeyValueScanner s) throws IOException { Instead, override this method:   public KeyValueScanner preStoreScannerOpen(final ObserverContext<RegionCoprocessorEnvironment> c,       final Store store, final Scan scan, final NavigableSet<byte[]> targetCols,       final KeyValueScanner s, final long readPt) throws IOException {

    Description

      RegionObserver.preStoreScannerOpen() doesn't have acces to current readpoint. This is crucial e.g. when creating a new StoreScanner.

      Although it is possible to obtain the readpoint via following workaround:

      ((HStore)store).getHRegion().getReadpoint(IsolationLevel.READ_COMMITTED)

      ...it presumes some knowledge of HBase internals and is not a clear option for user.

      The problem was introduced in HBASE-9754, where readpoint was introduced as an argument to StoreScanner constructor, but wasn't passed to the preStoreScannerOpen() hook in HStore.getScanner().

      In our case it led to bug, when we were incorrectly using smallestReadpoint() instead, which made coprocessor missing data in some cases [1].

      __________
      [1] http://mail-archives.apache.org/mod_mbox/hbase-dev/201604.mbox/%3CCAOUjMkwptCGacQ0d-4yOinDVBT%2Bbi2NOZee0fSbq%2Bk1R6V4-aw%40mail.gmail.com%3E

      Attachments

        1. 15759.v1.patch
          4 kB
          Ted Yu
        2. 15759.v2.patch
          6 kB
          Ted Yu
        3. 15759.v3.patch
          8 kB
          Ted Yu
        4. 15759.v4.patch
          8 kB
          Ted Yu

        Activity

          People

            yuzhihong@gmail.com Ted Yu
            mnicky Marek Srank
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: