-
Notifications
You must be signed in to change notification settings - Fork 409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PageStorage v3 modules combine. #3795
Conversation
call test: BlobStoreTest.testBlobStoreGcStats2 Error from - BlobStore::write - BlobStore::getBlobFile - DB::LRUCache - std::map The ptr in __hash:87 will be lost. And if i remove the `ro_ids` in BlobStore.h, it won't show again... Anyway `ro_ids` is useless.
[REVIEW NOTIFICATION] This pull request has not been approved. To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Signed-off-by: JaySon-Huang <[email protected]>
Signed-off-by: JaySon-Huang <[email protected]>
Add test for VersionedEntries. Need merge by hand, please wait...
dbms/src/Storages/Page/Page.h
Outdated
@@ -88,7 +88,7 @@ struct PageEntry | |||
PageFieldOffsetChecksums field_offsets{}; | |||
|
|||
public: | |||
inline bool isValid() const { return file_id != 0; } | |||
inline bool isValid() const { return file_id != 0 && file_id != INVALID_BLOBFILE_ID; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe make INVAILD_BLOBFILE_ID
be 0
?
This PR mixes too many changes in different components, suggest splitting these two changes into separate PRs:
|
} | ||
|
||
bool PageStorageImpl::gc(bool not_skip, const WriteLimiterPtr & write_limiter, const ReadLimiterPtr & read_limiter) | ||
{ | ||
/// Get all pending external pages and BlobFiles. Note that we should get external pages before BlobFiles. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- We should avoid this method being called by more than 1 thread at the same time.
- Return
false
if we didn't do any job this time. So that the scheduler won't call it again in the near future.
@@ -286,6 +382,14 @@ void PageDirectory::gcApply(const PageIdAndVersionedEntryList & migrated_entries | |||
|
|||
// TBD: wal apply | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should hold the lock instance in https://github.com/pingcap/tics/pull/3795/files#diff-1de4d86b0ebcbe77efe3ed6316f11350a64cdff662503b1eb9c48741d19a6b72R380
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
It is hard to locate which lines with the URL you post when the PR changes lots of lines. You should use "view file" to open the file and then copy the URL inside that file.
-
Do you mean this lock in this PR? PageStorage: Fix locks on BlobStore, PageDirectory #3897
https://github.com/pingcap/tics/blob/ca65a7b1b3b359c5b3624b7482fef6f69c01e3fc/dbms/src/Storages/Page/V3/PageDirectory.cpp#L285-L288
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually, I have fixed some locking issues in this pr.
- In
PageDirectory
, due to addedgetSnapshotsStat
, then we need to be added write_lock. Before we clear up snapshots ingc
. - Fix
max_cap
may cause inaccurate issues inBlobStore
. There is no need to add more locks in other methods ofBlobStore
, because this may lead to reentrancy problems or bring more lock problems, and we only need to ensure thatwrite
/read
/gc
happens at the same time, and there will be no concurrency problems. - If I'm missing something, I'd prefer to fix it in this PR, or after that, so I can use the adapted stress tool to verify it.
{ | ||
extern const Metric PSMVCCNumSnapshots; | ||
} // namespace CurrentMetrics | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a [[nodiscard]]
mark to VersionedPageEntries::acquireLock
.
@jiaqizho: PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@JaySon-Huang @flowbehappy |
What problem does this PR solve?
Issue Number: a part of #3594
Problem Summary:
What is changed and how it works?
remain
HeavySkewWriteRead.cpp
Check List
Tests
Side effects
Documentation
Release note