Github user navsan commented on a diff in the pull request:

    https://github.com/apache/incubator-quickstep/pull/25#discussion_r66700522
  
    --- Diff: storage/InsertDestination.cpp ---
    @@ -339,21 +339,20 @@ void 
BlockPoolInsertDestination::getPartiallyFilledBlocks(std::vector<MutableBlo
     }
     
     MutableBlockReference BlockPoolInsertDestination::getBlockForInsertion() {
    -  SpinMutexLock lock(mutex_);
    -  if (available_block_refs_.empty()) {
    -    if (available_block_ids_.empty()) {
    -      return createNewBlock();
    -    } else {
    +  {
    +    SpinMutexLock lock(mutex_);
    +    if (!available_block_refs_.empty()) {
    +      MutableBlockReference retval = 
std::move(available_block_refs_.back());
    +      available_block_refs_.pop_back();
    +      return retval;
    +    } else if (!available_block_ids_.empty()) {
           const block_id id = available_block_ids_.back();
           available_block_ids_.pop_back();
           MutableBlockReference retval = storage_manager_->getBlockMutable(id, 
relation_);
           return retval;
         }
    -  } else {
    -    MutableBlockReference retval = std::move(available_block_refs_.back());
    -    available_block_refs_.pop_back();
    -    return retval;
    -  }
    +  } // release mutex_ lock
    --- End diff --
    
    Fixed


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to