Skip to content

Commit 8c20046

Browse files
committed
[BugFix]fix deduplicate shared buffer when read from remote
Signed-off-by: zombee0 <[email protected]>
1 parent 73f946f commit 8c20046

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

be/src/io/cache_input_stream.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,6 @@ Status CacheInputStream::_read_block_from_local(const int64_t offset, const int6
146146
_stats.skip_read_cache_bytes += read_size;
147147
}
148148

149-
if (res.ok() && sb) {
150-
// Duplicate the block ranges to avoid saving the same data both in cache and shared buffer.
151-
_deduplicate_shared_buffer(sb);
152-
}
153-
154149
return res;
155150
}
156151

@@ -191,6 +186,11 @@ Status CacheInputStream::_read_blocks_from_remote(const int64_t offset, const in
191186
}
192187
}
193188

189+
if (sb) {
190+
// Duplicate the block ranges to avoid saving the same data both in block_map and shared buffer.
191+
_deduplicate_shared_buffer(sb);
192+
}
193+
194194
if (_enable_cache_io_adaptor) {
195195
int64_t delta_remote_bytes =
196196
_sb_stream->shared_io_bytes() + _sb_stream->direct_io_bytes() - previous_remote_bytes;

0 commit comments

Comments
 (0)