Skip to content

Commit

Permalink
Merge branch 'master' into mock_executors
Browse files Browse the repository at this point in the history
  • Loading branch information
ywqzzy authored Apr 15, 2022
2 parents 2a76598 + 1def5be commit e9dd228
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 6 deletions.
3 changes: 2 additions & 1 deletion dbms/src/Common/FailPoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ std::unordered_map<String, std::shared_ptr<FailPointChannel>> FailPointHelper::f
M(force_set_dtfile_exist_when_acquire_id) \
M(force_no_local_region_for_mpp_task) \
M(force_remote_read_for_batch_cop) \
M(force_context_path)
M(force_context_path) \
M(force_slow_page_storage_snapshot_release)

#define APPLY_FOR_FAILPOINTS_ONCE_WITH_CHANNEL(M) \
M(pause_after_learner_read) \
Expand Down
10 changes: 10 additions & 0 deletions dbms/src/Storages/DeltaMerge/DeltaMergeStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ extern const char force_triggle_foreground_flush[];
extern const char force_set_segment_ingest_packs_fail[];
extern const char segment_merge_after_ingest_packs[];
extern const char random_exception_after_dt_write_done[];
extern const char force_slow_page_storage_snapshot_release[];
} // namespace FailPoints

namespace DM
Expand Down Expand Up @@ -1036,11 +1037,20 @@ BlockInputStreams DeltaMergeStore::readRaw(const Context & db_context,
auto segment_snap = segment->createSnapshot(*dm_context, false, CurrentMetrics::DT_SnapshotOfReadRaw);
if (unlikely(!segment_snap))
throw Exception("Failed to get segment snap", ErrorCodes::LOGICAL_ERROR);

tasks.push_back(std::make_shared<SegmentReadTask>(segment, segment_snap, RowKeyRanges{segment->getRowKeyRange()}));
}
}
}

fiu_do_on(FailPoints::force_slow_page_storage_snapshot_release, {
std::thread thread_hold_snapshots([tasks]() {
std::this_thread::sleep_for(std::chrono::seconds(5 * 60));
(void)tasks;
});
thread_hold_snapshots.detach();
});

auto after_segment_read = [&](const DMContextPtr & dm_context_, const SegmentPtr & segment_) {
this->checkSegmentUpdate(dm_context_, segment_, ThreadType::Read);
};
Expand Down
2 changes: 1 addition & 1 deletion dbms/src/Storages/Page/PageStorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ struct ExternalPageCallbacks

/**
* A storage system stored pages. Pages are serialized objects referenced by PageID. Store Page with the same PageID
* will covered the old ones.
* will cover the old ones.
* Users should call #gc() constantly to release disk space.
*
* This class is multi-threads safe. Support multi threads write, and multi threads read.
Expand Down
4 changes: 2 additions & 2 deletions dbms/src/Storages/Page/V1/PageStorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ namespace DB::PS::V1

/**
* A storage system stored pages. Pages are serialized objects referenced by PageId. Store Page with the same PageId
* will covered the old ones. The file used to persist the Pages called PageFile. The meta data of a Page, like the
* latest PageFile the Page is stored , the offset in file, and checksum, are cached in memory. Users should call
* will cover the old ones. The file used to persist the Pages called PageFile. The meta data of a Page, like the
* latest PageFile the Page is stored, the offset in file, and checksum, are cached in memory. Users should call
* #gc() constantly to clean up the sparse PageFiles and release disk space.
*
* This class is multi-threads safe. Support single thread write, and multi threads read.
Expand Down
4 changes: 2 additions & 2 deletions dbms/src/Storages/Page/V2/PageStorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ namespace PS::V2
{
/**
* A storage system stored pages. Pages are serialized objects referenced by PageID. Store Page with the same PageID
* will covered the old ones. The file used to persist the Pages called PageFile. The meta data of a Page, like the
* latest PageFile the Page is stored , the offset in file, and checksum, are cached in memory. Users should call
* will cover the old ones. The file used to persist the Pages called PageFile. The meta data of a Page, like the
* latest PageFile the Page is stored, the offset in file, and checksum, are cached in memory. Users should call
* #gc() constantly to clean up the sparse PageFiles and release disk space.
*
* This class is multi-threads safe. Support multi threads write, and multi threads read.
Expand Down
1 change: 1 addition & 0 deletions dbms/src/Storages/Page/V3/BlobStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -978,6 +978,7 @@ void BlobStore::BlobStats::restore()

for (auto & [path, stats] : stats_map)
{
(void)path;
for (const auto & stat : stats)
{
stat->recalculateSpaceMap();
Expand Down

0 comments on commit e9dd228

Please sign in to comment.