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

Rework Block and Index cache #1473

Merged
merged 12 commits into from
Aug 25, 2020
Merged

Rework Block and Index cache #1473

merged 12 commits into from
Aug 25, 2020

Conversation

jarifibrahim
Copy link
Contributor

@jarifibrahim jarifibrahim commented Aug 21, 2020

This PR separates the block cache and the index cache. Earlier we had a mix of both the caches.
Block Cache -> Stores block. Should be used when running badger with compression/encryption
Index Cache -> Used to limit the memory used by table indices and bloom filters.

This PR also remove the KeepBlocksInCache and KeepBlockIndicesInCache options.


This change is Reviewable

Copy link
Contributor

@ahsanbarkati ahsanbarkati left a comment

Choose a reason for hiding this comment

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

:lgtm:

badger/cmd/read_bench.go Show resolved Hide resolved
badger/cmd/write_bench.go Show resolved Hide resolved
@jarifibrahim jarifibrahim marked this pull request as ready for review August 24, 2020 09:34
Copy link
Contributor

@ashish-goswami ashish-goswami left a comment

Choose a reason for hiding this comment

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

Most of the changes are refactoring. :lgtm:

Reviewed 6 of 12 files at r1, 6 of 6 files at r2.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @jarifibrahim and @manishrjain)


table/table.go, line 116 at r2 (raw file):

	blockIndex []*pb.BlockOffset
	ref        int32    // For file garbage collection. Atomic.
	bf         *z.Bloom // Nil if BfCache is set.

Undo this.

badger/cmd/write_bench.go Outdated Show resolved Hide resolved
options.go Outdated Show resolved Hide resolved
options.go Outdated Show resolved Hide resolved
table/table.go Show resolved Hide resolved
Ibrahim Jarif and others added 2 commits August 24, 2020 17:34
Co-authored-by: Naman Jain <[email protected]>
Co-authored-by: Naman Jain <[email protected]>
Copy link
Contributor

@ashish-goswami ashish-goswami left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 2 of 2 files at r3.
Reviewable status: 11 of 12 files reviewed, 5 unresolved discussions (waiting on @ashish-goswami, @jarifibrahim, and @manishrjain)

Copy link
Contributor

@NamanJain8 NamanJain8 left a comment

Choose a reason for hiding this comment

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

Reviewed 5 of 12 files at r1, 4 of 6 files at r2, 1 of 2 files at r3, 1 of 1 files at r4, 1 of 1 files at r5.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @jarifibrahim, @manishrjain, and @NamanJain8)

Copy link
Contributor

@manishrjain manishrjain left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @jarifibrahim, @manishrjain, and @NamanJain8)

@jarifibrahim jarifibrahim dismissed ashish-goswami’s stale review August 25, 2020 10:36

Review comments addressed

@jarifibrahim jarifibrahim merged commit c3b1582 into master Aug 25, 2020
@jarifibrahim jarifibrahim deleted the ibrahim/cache-changes-1 branch August 25, 2020 10:38
jarifibrahim pushed a commit that referenced this pull request Aug 25, 2020
This PR separates the block cache and the index cache. Earlier we had a mix of both the caches.
Block Cache -> Stores block. Should be used when running badger with compression/encryption
Index Cache -> Used to limit the memory used by table indices and bloom filters.

This PR also remove the `KeepBlocksInCache` and `KeepBlockIndicesInCache` options.

(cherry picked from commit c3b1582)
jarifibrahim pushed a commit that referenced this pull request Aug 25, 2020
This PR separates the block cache and the index cache. Earlier we had a mix of both the caches.
Block Cache -> Stores block. Should be used when running badger with compression/encryption
Index Cache -> Used to limit the memory used by table indices and bloom filters.

This PR also remove the `KeepBlocksInCache` and `KeepBlockIndicesInCache` options.

(cherry picked from commit c3b1582)
jarifibrahim pushed a commit that referenced this pull request Aug 26, 2020
This PR separates the block cache and the index cache. Earlier we had a mix of both the caches.
Block Cache -> Stores blocks. Should be used when running badger with compression/encryption
Index Cache -> Used to limit the memory used by table indices and bloom filters.

This PR also remove the `KeepBlocksInCache` and `KeepBlockIndicesInCache` options.

(cherry picked from commit c3b1582)
jarifibrahim pushed a commit that referenced this pull request Oct 2, 2020
This PR separates the block cache and the index cache. Earlier we had a mix of both the caches. 
Block Cache -> Stores block. Should be used when running badger with compression/encryption
Index Cache -> Used to limit the memory used by table indices and bloom filters. 

This PR also remove the `KeepBlocksInCache` and `KeepBlockIndicesInCache` options.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants