-
Notifications
You must be signed in to change notification settings - Fork 1k
Updated catalog compaction arg, small pipelines fixes #10743
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
Updated catalog compaction arg, small pipelines fixes #10743
Conversation
🦋 Changeset detectedLatest commit: 7f68455 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Failed to automatically backport this PR's changes to Wrangler v3. Please manually create a PR targeting the Depending on your changes, running Notes:
|
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
wrangler
commit: |
1f708de
to
d248cfa
Compare
file_size_bytes?: number; | ||
interval_seconds: number; |
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.
Just noting that file size is now optional but interval is not?
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.
yes that's correct, since interval_seconds has a default so should always be present
"The target size for compacted files in MB (allowed values: 64, 128, 256, 512)", | ||
type: "number", | ||
demandOption: false, | ||
default: 128, |
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.
Pretty sure that by having a default here, this option will never be undefined
which might mess up your logic later?
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 might be totally wrong but in other parts of Wrangler we have a pattern where a value can be configured in both the Wrangler config file but also on the command line.
In that case it is important that we don't have a default for the command line arg because then we never know if the user actually specified a value or whether it is just the default, so we don't know whether to override what is in the config.
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.
OK I am totally wrong. I see that this option doesn't get merged with other config. So it is all good.
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 note that now this value is used in the only call to enabledR2CatalogCompaction()
, which expects the value of targetSizeMb
to be number|undefined
.
But since this will always be defined (thanks to the default value) then that function could just take number
.
The follow on is that R2CatalogCompactionConfig
can make its targetSizMb
to be only number
. Making this comment redundant:
// If undefined, the service will set the default value
d248cfa
to
7f68455
Compare
"The target size for compacted files in MB (allowed values: 64, 128, 256, 512)", | ||
type: "number", | ||
demandOption: false, | ||
default: 128, |
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 note that now this value is used in the only call to enabledR2CatalogCompaction()
, which expects the value of targetSizeMb
to be number|undefined
.
But since this will always be defined (thanks to the default value) then that function could just take number
.
The follow on is that R2CatalogCompactionConfig
can make its targetSizMb
to be only number
. Making this comment redundant:
// If undefined, the service will set the default value
Updated catalog compaction enable argument from targetSizeMb to target-size. Small fixes for pipelines commands, defaults.
CR-1309255