Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-1954

Reserve chunks of numbers for a sequence

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments


    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.5.0
    • Component/s: None
    • Labels:


      In order to be able to generate many ids in bulk (for example in map reduce jobs) we need a way to generate or reserve large sets of ids. We also need to mix ids reserved with incrementally generated ids from other clients.

      For this we need to atomically increment the sequence and return the value it had when the increment happened.

      If we're OK to throw the current cached set of values away we can do
      NEXT VALUE FOR <seq>(,<N>), that needs to increment value and return the value it incremented from (i.e. it has to throw the current cache away, and return the next value it found at the server).

      Or we can invent a new syntax RESERVE VALUES FOR <seq>, <N> that does the same, but does not invalidate the cache.

      Note that in either case we won't retrieve the reserved set of values via NEXT VALUE FOR because we'd need to be idempotent in our case, all we need to guarantee is that after a call to RESERVE VALUES FOR <seq>, <N>, which returns a value <M> is that the range [M, M+N) won't be used by any other user of the sequence. My might need reserve 1bn ids this way ahead of a map reduce run.

      Any better ideas?


        1. PHOENIX-1954-wip.patch
          29 kB
          James R. Taylor
        2. PHOENIX-1954-wip2.patch.txt
          82 kB
          Jan Fernando
        3. PHOENIX-1954-wip3.patch
          105 kB
          Jan Fernando
        4. PHOENIX-1954-wip4.patch
          141 kB
          Jan Fernando
        5. PHOENIX-1954-rebased.patch
          105 kB
          Jan Fernando
        6. PHOENIX-1954-wip5-rebased.patch
          104 kB
          Jan Fernando
        7. PHOENIX-1954-wip6.patch
          133 kB
          Jan Fernando
        8. PHOENIX-1954-wip7-rebase.patch
          115 kB
          Jan Fernando
        9. PHOENIX-1954-4.x-HBase-0.98.patch
          117 kB
          Jan Fernando



            • Assignee:
              jfernando_sfdc Jan Fernando
              larsh Lars Hofhansl


              • Created:

                Issue deployment