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

bug: insert value size is zero #338

Closed
xiaguan opened this issue Apr 14, 2024 · 2 comments · Fixed by #380
Closed

bug: insert value size is zero #338

xiaguan opened this issue Apr 14, 2024 · 2 comments · Fixed by #380
Assignees
Labels
bug Something isn't working
Milestone

Comments

@xiaguan
Copy link
Contributor

xiaguan commented Apr 14, 2024

Reproduce commands(by fuzz)

        Input {
            capacity: 95,
            cache_type: S3Fifo,
            operations: [
                Insert(
                    0,
                    0,
                    0,
                ),
                Insert(
                    33,
                    33,
                    143,
                ),
            ],
        }
thread '<unnamed>' panicked at /home/susun/foyer/foyer-memory/src/eviction/s3fifo.rs:223:13:
assertion failed: self.is_empty()
@MrCroxx
Copy link
Collaborator

MrCroxx commented Apr 14, 2024

evict may return None even then cache is not empty.

https://github.com/MrCroxx/foyer/blob/main/foyer-memory/src/eviction/s3fifo.rs#L141-L182

If the small queue eviction will be skipped.

https://github.com/MrCroxx/foyer/blob/main/foyer-memory/src/eviction/s3fifo.rs#L161

And this line subtracts the wrong charges. 🥹 I'll fix the bugs.

@MrCroxx MrCroxx added the bug Something isn't working label Apr 15, 2024
@MrCroxx MrCroxx added this to the v0.8 milestone Apr 17, 2024
@MrCroxx
Copy link
Collaborator

MrCroxx commented Apr 17, 2024

evict may return None even then cache is not empty.

https://github.com/MrCroxx/foyer/blob/main/foyer-memory/src/eviction/s3fifo.rs#L141-L182

If the small queue eviction will be skipped.

https://github.com/MrCroxx/foyer/blob/main/foyer-memory/src/eviction/s3fifo.rs#L161

And this line subtracts the wrong charges. 🥹 I'll fix the bugs.

#360

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

2 participants