8000 Fixed 2 issues: Memory resource not released and flushing of non-dirty pages by alicia-lyu · Pull Request #24 · leanstore/leanstore · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fixed 2 issues: Memory resource not released and flushing of non-dirty pages #24

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

alicia-lyu
Copy link

Fixed 2 issues:

  • Several resources not released when the executable exits, leading to it not passing AddressSanitizer.
  • BufferFrame::isDirty() flushes page with PLSN == 0, which are not modified, I believe. With the original code, experiments recovered from existing DB with read-only TXs witness page writes consistently above zero.

The fixed code passes multiple runs of various experiments, including persisting and recovering (& verifying). But I would still appreciate a set of fresh eyes, especially because the changes are cherrypicked from my branch.

@@ -51,6 +51,7 @@ class CRManager
~CRManager();
// -------------------------------------------------------------------------------------
void registerMeAsSpecialWorker();
void deleteSpecialWorker();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do you need this?

Copy link
Author

Choose a reason for hiding this comment

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

The memory for the special worker is not released. It does not pass address sanitizer.

@@ -81,7 +81,10 @@ struct BufferFrame {
// -------------------------------------------------------------------------------------
bool operator==(const BufferFrame& other) { return this == &other; }
// -------------------------------------------------------------------------------------
inline bool isDirty() const { return page.PLSN != header.last_written_plsn; }
inline bool isDirty() const { return
page.PLSN != 0 && // marked as dirty
Copy link
Collaborator

Choose a reason for hiding this comment

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

PLSN will increase monotonically and will be increased here:
https://github.com/leanstore/leanstore/blob/master/backend/leanstore/sync-primitives/PageGuard.hpp#L122C1-L127C23
That means, your first condition is inclusive with page.PLSN != header.last_written_plsn

Copy link
Author

Choose a reason for hiding this comment

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

If the page is only read but not written, it should not be flushed. My experiments also see write volume for read-only workload.

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
0