Uploaded image for project: 'TinkerPop'
  1. TinkerPop
  2. TINKERPOP-2475

Barrier step touches one more element of next loop

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.4.8
    • 3.5.0, 3.4.9
    • process
    • None

    Description

      This bug will preload one more element in barrier action. For example, if we have 4 vertices, and we have a barrier(2) step, we expect to get the first 2 in a barrier then the last 2 in another barrier loop. But when we get the first 2 vertices, the third one has already been loaded.

      The root cause is below code: 

      @Override
      public void processAllStarts() {
          while (this.starts.hasNext() && (this.maxBarrierSize == Integer.MAX_VALUE || this.barrier.size() < this.maxBarrierSize)) {
              final Traverser.Admin<S> traverser = this.starts.next();
              traverser.setStepId(this.getNextStep().getId()); // when barrier is reloaded, the traversers should be at the next step
              this.barrier.add(traverser);
          }
      }
      

      In while loop, we use this.starts.hasNext() at first, and it will cause the vertex loading action. It will affect the performance when the vertex is saved in DB instead of memory.

       

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            spmallette Stephen Mallette
            deliliu Liu-Delin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment