Skip to content

Commit

Permalink
Merge pull request duckdb#13417 from Mytherin/setreadersafterio
Browse files Browse the repository at this point in the history
Buffer manager: set handle readers after I/O so that any I/O exceptions don't leave the readers with an invalid value
  • Loading branch information
Mytherin authored Aug 14, 2024
2 parents 4e3a192 + 2f23a1d commit 709a18d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/storage/standard_buffer_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,8 @@ BufferHandle StandardBufferManager::Pin(shared_ptr<BlockHandle> &handle) {
} else {
// now we can actually load the current block
D_ASSERT(handle->readers == 0);
handle->readers = 1;
buf = handle->Load(handle, std::move(reusable_buffer));
handle->readers = 1;
handle->memory_charge = std::move(reservation);
// in the case of a variable sized block, the buffer may be smaller than a full block.
int64_t delta =
Expand Down

0 comments on commit 709a18d

Please sign in to comment.