Sitelet https://github.com/leanstore/leanstore/pull/24
Skip to content

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

Open
alicia-lyu wants to merge 2 commits into
leanstore:masterfrom
alicia-lyu:fix-mem
Open

alicia-lyu wants to merge 2 commits into
leanstore:masterfrom
alicia-lyu:fix-mem

Conversation

@alicia-lyu

Copy link
Copy Markdown

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.

~CRManager();
// -------------------------------------------------------------------------------------
void registerMeAsSpecialWorker();
void deleteSpecialWorker();

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

// -------------------------------------------------------------------------------------
inline bool isDirty() const { return page.PLSN != header.last_written_plsn; }
inline bool isDirty() const { return
page.PLSN != 0 && // marked as dirty

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

alicia-lyu added a commit to alicia-lyu/leanstore that referenced this pull request May 3, 2026
…varying-param harness)

- §3.5 §4: add three-framing cardinality typology (pure hierarchical /
  hierarchical + sibling sub-aggregate / genuine tree); cross-ref anti-pattern leanstore#27
- §3.5 §5: add required "Params baked in" column + soundness rule forbidding
  parameterised-filter baking in secondaries
- §3.5 §7: add explicit no-parameterised-filter bullet
- §3.5 §8: add composition-with-sibling-queries guidance (DRY, not inheritance)
- §3.6: add set_params_for_iter param-cycling hook requirement to skeleton
- §5: replace brief Params blurb with deterministic param-table requirement +
  why-required rationale (Q3I pre_revenue bug)
- §7.3: rewrite S2 around per-lineitem view (post-audit shape); remove
  obsolete baked-filter pitfall
- §7.4: rewrite S5 around rebuilt 3-type aCOLI; retire [SKIP S5] guard;
  correct spectrum-position framing
- §10: add off-default param verification subsection
- §13: retire row leanstore#10 (fix was the bug); add rows leanstore#24-leanstore#27 (baked param,
  fixed-param loop, [SKIP] guard, cardinality framing)
- §14: add off-default param checklist item

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
alicia-lyu added a commit to alicia-lyu/leanstore that referenced this pull request May 18, 2026
…varying-param harness)

- §3.5 §4: add three-framing cardinality typology (pure hierarchical /
  hierarchical + sibling sub-aggregate / genuine tree); cross-ref anti-pattern leanstore#27
- §3.5 §5: add required "Params baked in" column + soundness rule forbidding
  parameterised-filter baking in secondaries
- §3.5 §7: add explicit no-parameterised-filter bullet
- §3.5 §8: add composition-with-sibling-queries guidance (DRY, not inheritance)
- §3.6: add set_params_for_iter param-cycling hook requirement to skeleton
- §5: replace brief Params blurb with deterministic param-table requirement +
  why-required rationale (Q3I pre_revenue bug)
- §7.3: rewrite S2 around per-lineitem view (post-audit shape); remove
  obsolete baked-filter pitfall
- §7.4: rewrite S5 around rebuilt 3-type aCOLI; retire [SKIP S5] guard;
  correct spectrum-position framing
- §10: add off-default param verification subsection
- §13: retire row leanstore#10 (fix was the bug); add rows leanstore#24-leanstore#27 (baked param,
  fixed-param loop, [SKIP] guard, cardinality framing)
- §14: add off-default param checklist item

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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