-
Notifications
You must be signed in to change notification settings - Fork 3.7k
feat: Remove Last Cache Size Limitation #26333
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
Changes from all commits
e9615d5
434ba5f
862a89f
e7537f4
edca7f9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -249,7 +249,7 @@ expression: catalog.snapshot() | |
| 2, | ||
| 3 | ||
| ], | ||
| "n": 10, | ||
| "n": 100, | ||
| "ttl": 500 | ||
| } | ||
| ] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -380,18 +380,15 @@ pub enum LastCacheValueColumnsDef { | |
| AllNonKeyColumns, | ||
| } | ||
|
|
||
| /// The maximum allowed size for a last cache | ||
| pub const LAST_CACHE_MAX_SIZE: usize = 10; | ||
|
|
||
| /// The size of the last cache | ||
| /// | ||
| /// Must be between 1 and [`LAST_CACHE_MAX_SIZE`] | ||
| /// Must be greater than 0 | ||
| #[derive(Debug, Serialize, Eq, PartialEq, Clone, Copy)] | ||
| pub struct LastCacheSize(pub(crate) usize); | ||
|
Comment on lines
+385
to
387
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a textbook use case for /// Must be greater than 0
#[derive(Debug, Serialize, Eq, PartialEq, Clone, Copy)]
pub struct LastCacheSize(pub(crate) NonZeroUsize);
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks like it'll be more involved given implementations across the DB will have to be updated; I can do that update, would want to do it in a separate chore though if that's alright. If you've reconsidered and do think it should be blocking, let me know and I'll make the update.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No worries. We can refactor this later |
||
|
|
||
| impl LastCacheSize { | ||
| pub fn new(size: usize) -> Result<Self> { | ||
| if size == 0 || size > LAST_CACHE_MAX_SIZE { | ||
| if size == 0 { | ||
| Err(CatalogError::InvalidLastCacheSize) | ||
| } else { | ||
| Ok(Self(size)) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.