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

go/libraries/doltcore/dbfactory: Thread memory quota provider through store layer to onHeapTableIndex #3080

Merged
merged 4 commits into from
Mar 29, 2022

Conversation

druvv
Copy link
Contributor

@druvv druvv commented Mar 24, 2022

This PR allows creators of noms block stores to manage memory resources related to them.

@druvv druvv requested a review from reltuk March 24, 2022 19:31
Copy link
Contributor

@reltuk reltuk left a comment

Choose a reason for hiding this comment

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

Looks great. One comment :)

ae.SetIfError(err)
return
}
err = ts.q.AcquireQuota(ctx, memSize)
Copy link
Contributor

Choose a reason for hiding this comment

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

This might work fine for now. But I'm concerned about the double-counting overhead when we're rebasing a large repository..AFAIU, the interaction is basically

newtableset, err := tableset.Rebase(...)
if err ...
tableset.Close()
tableset = newtableset

Also AFAIU, the mmap machinery already requires that explicitly manage the lifecycle of these index (.Clone()). So...one way to get around this double counting is by moving the ReleaseQuota call into the tableIndex Close() function (Close(ctx, MemoryQuotaProvider) error) and adding reference counting to onHeapTableIndex as well.

Any thoughts?

@druvv druvv changed the title go/libraries/doltcore/dbfactory: Thread memory quota provider through store layer to nbs.tableSet go/libraries/doltcore/dbfactory: Thread memory quota provider through store layer to onHeapTableIndex Mar 29, 2022
@druvv
Copy link
Contributor Author

druvv commented Mar 29, 2022

tested these Dolt changes against LD tests just to make sure I didn't break something

@druvv druvv merged commit b9f29fd into main Mar 29, 2022
@Hydrocharged Hydrocharged deleted the dhruv/memory-quota branch April 10, 2022 10:38
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.

None yet

2 participants