Skip to content
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

Closed
wants to merge 7 commits into from
Closed

Review result #376

wants to merge 7 commits into from

Conversation

innerr
Copy link
Contributor

@innerr innerr commented Dec 27, 2019

No description provided.

@innerr innerr changed the title VersionSet review Review result Dec 27, 2019
@@ -105,6 +108,7 @@ class VersionSet

virtual ~VersionSet()
{
// REVIEW: why this doesn't need the mutex?
Copy link
Contributor

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?
Copy link
Contributor

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...

@@ -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
Copy link
Contributor

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

@@ -2,6 +2,7 @@

#include <cassert>
#include <optional>
// REVIEW: mutex unused
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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?
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@innerr
Copy link
Contributor Author

innerr commented Dec 31, 2019

All addressed, close this now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants