Skip to content

Commit

Permalink
Reduce unnecessary S3 read flow after restart (#7533)
Browse files Browse the repository at this point in the history
close #7513
  • Loading branch information
JaySon-Huang authored May 24, 2023
1 parent c90ecbd commit b6629f1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
13 changes: 9 additions & 4 deletions dbms/src/Storages/DeltaMerge/DeltaMergeStore_InternalBg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,11 +275,16 @@ void DeltaMergeStore::setUpBackgroundTask(const DMContextPtr & dm_context)

blockable_background_pool_handle = blockable_background_pool.addTask([this] { return handleBackgroundTask(true); });

// Generate place delta index tasks
for (auto & [end, segment] : segments)
// Under disagg mode, a write node could serve large amount of data, place delta index tasks
// after restart is useless and waste of S3 reading. Only do it when deployed non-disagg mode.
if (global_context.getSharedContextDisagg()->notDisaggregatedMode())
{
(void)end;
checkSegmentUpdate(dm_context, segment, ThreadType::Init);
// Generate place delta index tasks
for (auto & [end, segment] : segments)
{
(void)end;
checkSegmentUpdate(dm_context, segment, ThreadType::Init);
}
}

// Wake up to do place delta index tasks.
Expand Down
5 changes: 3 additions & 2 deletions dbms/src/Storages/S3/S3RandomAccessFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,10 @@ ssize_t S3RandomAccessFile::readImpl(char * buf, size_t size)
{
LOG_ERROR(
log,
"Cannot read from istream, gcount={}, eof={}, cur_offset={}, content_length={}, errmsg={}, cost={}ns",
"Cannot read from istream, size={} gcount={} state=0x{:02X} cur_offset={} content_length={} errmsg={} cost={}ns",
size,
gcount,
istr.eof(),
istr.rdstate(),
cur_offset,
content_length,
strerror(errno),
Expand Down

0 comments on commit b6629f1

Please sign in to comment.