-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[VTAdmin API] Fix schema cache flag, add documentation #15704
Changes from all commits
3105f46
15cd274
60f5b9a
1ac236a
eb0f7b7
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 |
---|---|---|
|
@@ -54,6 +54,9 @@ const ( | |
// backfill requests to still process, if a config is passed with a | ||
// non-positive BackfillRequestTTL. | ||
DefaultBackfillRequestTTL = time.Millisecond * 100 | ||
// DefaultBackfillQueueSize is the default value used for the size of the | ||
// backfill queue, if a config is passed with a non-positive BackfillQueueSize. | ||
DefaultBackfillQueueSize = 0 | ||
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. 0 means that we don’t backfill? 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. I think it means that the underlying channel will have a size of 0, and every send to the backfill queue will block until the queue is "empty" again. If that's non-ideal, we can change it to 1. I had it at 1 but that broke an existing test assumption. |
||
) | ||
|
||
// Config is the configuration for a cache. | ||
|
@@ -125,6 +128,11 @@ func New[Key Keyer, Value any](fillFunc func(ctx context.Context, req Key) (Valu | |
cfg.BackfillRequestTTL = DefaultBackfillRequestTTL | ||
} | ||
|
||
if cfg.BackfillQueueSize < 0 { | ||
mattlord marked this conversation as resolved.
Show resolved
Hide resolved
|
||
log.Warningf("BackfillQueueSize (%v) must be positive, defaulting to %v", cfg.BackfillQueueSize, DefaultBackfillQueueSize) | ||
cfg.BackfillQueueSize = DefaultBackfillQueueSize | ||
} | ||
|
||
c := &Cache[Key, Value]{ | ||
cache: cache.New(cfg.DefaultExpiration, cfg.CleanupInterval), | ||
lastFill: map[string]time.Time{}, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does 0 mean? Unlimited?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope this answers the question:
#15704 (comment)