Skip to content

backupccl: replace memory accumulator with bound account#74479

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
adityamaru:rework-file-stitching-mem-monitor
Jan 7, 2022
Merged

backupccl: replace memory accumulator with bound account#74479
craig[bot] merged 1 commit intocockroachdb:masterfrom
adityamaru:rework-file-stitching-mem-monitor

Conversation

@adityamaru
Copy link
Copy Markdown
Contributor

This change replaces the memory accumulator with a raw bound
account. The memory accumulator provides a threadsafe wrapper
around the bound account, and some redundant resource pooling
semantics. Both of these are currently not needed by the sstSink
that is being memory monitored. This change deletes the memory
accumulator.

Release note: None

@adityamaru adityamaru requested review from a team and dt January 5, 2022 22:27
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

// accumulator.
s.backupMem.release(smallFileBuffer.Get(s.conf.settings))
// Release the memory reserved for the file buffer.
s.memAcc.Shrink(s.ctx, smallFileBuffer.Get(s.conf.settings))
Copy link
Copy Markdown
Contributor

@dt dt Jan 6, 2022

Choose a reason for hiding this comment

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

I know this is in the existing code, but this should really read the the setting once before it goes to Grow and then store how much it asked for and then release that -- Shrinking the current value of the setting does not really ensure we shrinked by as much as we grew.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

good point, done.

@adityamaru adityamaru force-pushed the rework-file-stitching-mem-monitor branch 2 times, most recently from 8dc7081 to 09ab665 Compare January 6, 2022 20:59
This change replaces the memory accumulator with a raw bound
account. The memory accumulator provides a threadsafe wrapper
around the bound account, and some redundant resource pooling
semantics. Both of these are currently not needed by the sstSink
that is being memory monitored. This change deletes the memory
accumulator.

Release note: None
@adityamaru adityamaru force-pushed the rework-file-stitching-mem-monitor branch from 09ab665 to 21118a0 Compare January 6, 2022 21:01
@adityamaru
Copy link
Copy Markdown
Contributor Author

TFTR!

bors r=dt

@craig craig bot merged commit 2ffb8b2 into cockroachdb:master Jan 7, 2022
@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jan 7, 2022

Build succeeded:

@adityamaru adityamaru deleted the rework-file-stitching-mem-monitor branch January 7, 2022 02:31
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