-
Notifications
You must be signed in to change notification settings - Fork 411
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
Review result #376
Review result #376
Conversation
@@ -105,6 +108,7 @@ class VersionSet | |||
|
|||
virtual ~VersionSet() | |||
{ | |||
// REVIEW: why this doesn't need the mutex? |
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.
All versions of this VersionSet must be released before destructuring VersionSet, so we don't need to lock on mutex.
@@ -183,9 +188,11 @@ class VersionSet | |||
} | |||
|
|||
protected: | |||
// REVIEW: why can't we just use std::list? |
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 thought we can lock on small parts of versions instead of the whole version-list, but now it seems to be the same as lock over the list...
dbms/src/Storages/Page/PageEntries.h
Outdated
@@ -232,6 +233,7 @@ void PageEntriesMixin<T>::put(PageId page_id, const PageEntry & entry) | |||
max_page_id = std::max(max_page_id, page_id); | |||
} | |||
|
|||
// REVIEW: the name `move` confused me for a while, until I see this code |
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.
Rename to updateNormalPage
// REVIEW: small opinion: I think this is a bit over engineering, cause this struct doesn't need to serialize, | ||
// even if it need to serialize, we could use pragma packing, | ||
// or use union{char, uint32}, union can be more reliable (if we change the type of WriteType, it don't cause problem) | ||
// manually padding seems to be the worst way to do it. |
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.
OK
dbms/src/Storages/Page/PageEntries.h
Outdated
@@ -2,6 +2,7 @@ | |||
|
|||
#include <cassert> | |||
#include <optional> | |||
// REVIEW: mutex unused |
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.
OK
VersionType placeholder_node; // Head of circular double-linked list of all versions | ||
VersionPtr current; // current version; current == placeholder_node.prev | ||
|
||
// REVIEW: this name is not accurate, cause this mutex also be used for editing |
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.
OK
@@ -341,6 +343,7 @@ class VersionSetWithDelta | |||
} | |||
|
|||
protected: | |||
// REVIEW: this name is not accurate, cause this mutex also be used for editing |
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.
OK
@@ -292,6 +293,7 @@ class VersionSetWithDelta | |||
tail.reset(); | |||
} | |||
|
|||
// REVIEW: maybe relocate this two methods to VersionType? |
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.
Done
@@ -131,6 +131,7 @@ class VersionSetWithDelta | |||
CurrentMetrics::add(CurrentMetrics::PSMVCCNumSnapshots); | |||
} | |||
|
|||
// REVIEW: make sure Snapshot is uncopyable, or this will go wrong |
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.
Done
@@ -140,6 +144,7 @@ class VersionSet | |||
return sz; | |||
} | |||
|
|||
// REVIEW: I read the tests, and I think lock it up should be better |
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.
Done
All addressed, close this now |
No description provided.