Skip to content

Base implementation of scheduled merges #426

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

Merged
merged 3 commits into from
Oct 29, 2024
Merged

Conversation

jorisdral
Copy link
Collaborator

@jorisdral jorisdral commented Oct 8, 2024

No description provided.

@jorisdral jorisdral marked this pull request as draft October 8, 2024 14:41
@jorisdral jorisdral self-assigned this Oct 8, 2024
@jorisdral jorisdral force-pushed the jdral/scheduled-merges branch from 49eb335 to c6d3191 Compare October 8, 2024 14:46
Base automatically changed from jdral/cache-references to jdral/fix-table-content-references October 8, 2024 20:45
@jorisdral jorisdral force-pushed the jdral/fix-table-content-references branch from 92f5b05 to a06bf8b Compare October 8, 2024 21:23
@jorisdral jorisdral changed the base branch from jdral/fix-table-content-references to jdral/cache-references October 8, 2024 21:26
@jorisdral jorisdral force-pushed the jdral/cache-references branch from 293d1eb to 6472fba Compare October 9, 2024 19:32
@jorisdral jorisdral force-pushed the jdral/scheduled-merges branch 3 times, most recently from 2cb14b8 to ed37bdb Compare October 9, 2024 22:59
Base automatically changed from jdral/cache-references to main October 10, 2024 12:02
@jorisdral jorisdral force-pushed the jdral/scheduled-merges branch 2 times, most recently from 3ac6360 to a840218 Compare October 14, 2024 08:13
@jorisdral jorisdral force-pushed the jdral/scheduled-merges branch from a840218 to 6eadec9 Compare October 15, 2024 14:30
Copy link
Collaborator Author

@jorisdral jorisdral left a comment

Choose a reason for hiding this comment

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

So since I did not get to clean up this PR yet, I'll leave some comments here for the reviewers. Note that I'm calling this a base implementation because the tests pass, though they are currently failing because of a semi-unrelated problem in control-test (see the last two PRs called WIP: fix failures). There are some optimisations we can still include. Most notably, rebuilding caches on lookups, and batching merging work. We can add those optimisations entirely separately in follow-up PRs

@jorisdral jorisdral force-pushed the jdral/scheduled-merges branch from 1e19bbd to 25f0251 Compare October 21, 2024 10:32
@jorisdral jorisdral marked this pull request as ready for review October 21, 2024 10:32
Copy link
Collaborator

@mheinzel mheinzel left a comment

Choose a reason for hiding this comment

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

No proper review, just things I saw while documenting resource management.

Copy link
Collaborator

@dcoutts dcoutts left a comment

Choose a reason for hiding this comment

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

This is looking very good.

The main thing that makes me a bit nervous is that we track merging steps done, but not credits supplied. My intuition is that like in the prototype, we should track the merge credits we expect we need for a merge, and the number actually supplied, and make sure the credits supplied is equal or greater than the credits required by the time the merge result is expected.

Comment on lines 711 to 726
pure (x, r)
OngoingMerge _rs _ _m -> do
-- TODO: should this complete the merge instead, and issue a warning
-- (e.g., through a trace message)? It is unclear what is best. On the
-- one hand, it is not a case we can not recover from, because we can
-- step the merge to completion. On the other hand calling
-- expectCompletedMerge on an incomplete merge actually means we have
-- a bug in our scheduling, since we take great care to ensure merges
-- always finish on time.
error "expectCompletedMerge: expected a completed merge, but found an ongoing merge"
Copy link
Collaborator

Choose a reason for hiding this comment

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

In debug-mode, this should fail, so using assert would make sense. In release mode, I think it would be sensible to complete the merge and log something. Logging a warning is a bit different than what we otherwise do with the tracer, but it seems like our best option for that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

#426 (comment)

So there seems to be some disagreement

@jorisdral jorisdral force-pushed the jdral/scheduled-merges branch from 58a8c73 to 6b3a366 Compare October 29, 2024 10:17
Copy link
Collaborator

@dcoutts dcoutts left a comment

Choose a reason for hiding this comment

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

LGTM. A couple minor comments below.

Review those comments and then ok to squash and merge as far as I'm concerned.

In some cases, we have to remove more than one reference at a time. For example,
when a merge is completed, then the reference count of each input run should be
reduced by value of the reference count of the output run. You can view this as
the references being "transferred" from the input runs to the output run.
Copy link
Collaborator

@dcoutts dcoutts left a comment

Choose a reason for hiding this comment

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

One query below.

@jorisdral jorisdral force-pushed the jdral/scheduled-merges branch 3 times, most recently from abc1e07 to bb95545 Compare October 29, 2024 13:33
The following features will be implemented later: rebuilding caches on lookups,
and doing merging work in batches.
And test with `Incremental` in the `StateMachine` tests.
@jorisdral jorisdral force-pushed the jdral/scheduled-merges branch from bb95545 to 27107f3 Compare October 29, 2024 13:41
@jorisdral jorisdral dismissed mheinzel’s stale review October 29, 2024 15:25

Resolved comments, and other things that might come up will be resolved in #435

@jorisdral jorisdral added this pull request to the merge queue Oct 29, 2024
Merged via the queue into main with commit 361f4dc Oct 29, 2024
24 checks passed
@jorisdral jorisdral deleted the jdral/scheduled-merges branch October 29, 2024 15:56
@dcoutts
Copy link
Collaborator

dcoutts commented Oct 29, 2024

🎉

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.

3 participants