Skip to content

clusterversion: add PebbleFormatSplitUserKeysMarked#77634

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
jbowens:split-user-keys-version
Mar 11, 2022
Merged

clusterversion: add PebbleFormatSplitUserKeysMarked#77634
craig[bot] merged 1 commit intocockroachdb:masterfrom
jbowens:split-user-keys-version

Conversation

@jbowens
Copy link
Copy Markdown
Contributor

@jbowens jbowens commented Mar 10, 2022

See cockroachdb/pebble#1495.

Add a new 22.1 cluster version that ratchets the Pebble format major version to
FormatSplitUserKeysMarked, performing an internal Pebble migration to mark
split user keys for compaction.

Release justification: high-priority migration
Release note: None

@jbowens jbowens requested a review from a team as a code owner March 10, 2022 20:39
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Collaborator

@nicktrav nicktrav 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 3 of 3 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @jbowens)

Copy link
Copy Markdown
Collaborator

@nicktrav nicktrav left a comment

Choose a reason for hiding this comment

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

I was thinking .. is it worth writing a roachtest that writes a bunch of "split" sstables (would have to be on an older binary, and I'm not sure if we have a way to ensure such a thing?) and then starts up with a new version of the binary and asserts that the migration completes, and that there are no more split keys? Perhaps with cheks={true,false}.

Maybe it's overkill, given we have test coverage in the single store case (via the Pebble tests). Happy to look into that if you think it adds value.

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @jbowens)

See cockroachdb/pebble#1495.

Add a new 22.1 cluster version that ratchets the Pebble format major version to
FormatSplitUserKeysMarked, performing an internal Pebble migration to mark
split user keys for compaction.

Release justification: high-priority migration
Release note: None
@jbowens jbowens force-pushed the split-user-keys-version branch from a9751f6 to 647f1af Compare March 10, 2022 21:41
Copy link
Copy Markdown
Collaborator

@nicktrav nicktrav left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 3 files at r2, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @jbowens)

Copy link
Copy Markdown
Contributor Author

@jbowens jbowens left a comment

Choose a reason for hiding this comment

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

That would be cool. I think there are some mixed-version roachtests that pull prebuilt older binaries to test upgrade flows, and those might provide prior art for doing something like that. But I'm not sure how to get CockroachDB to actually construct these "split" sstables though. I'd expect them to be exceedingly rare in practice. They require:

  • A key to be written twice. I'm not sure under what circumstances CockroachDB will even ever write a key multiple times, other than GC laying down a point tombstone or maybe keys within the range-local keyspace?
  • A LSM snapshot to be open between the two keys when the sstable is written.
  • The two or more identical keys need to happen to fall into the boundary of the sstables during a compaction.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @jbowens)

Copy link
Copy Markdown
Contributor Author

@jbowens jbowens left a comment

Choose a reason for hiding this comment

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

TFTR!

bors r=nicktrav

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @jbowens)

@craig
Copy link
Copy Markdown
Contributor

craig Bot commented Mar 11, 2022

Build succeeded:

@craig craig Bot merged commit 0fb2c0c into cockroachdb:master Mar 11, 2022
@jbowens jbowens deleted the split-user-keys-version branch March 11, 2022 03:54
jbowens added a commit to jbowens/cockroach that referenced this pull request Mar 30, 2022
Add a timeseries metric for the count of files marked for compaction.
This metric isn't universally useful but it's expected to be useful as a
timeseries metric within specific contexts, particularly surrounding
storage-engine background migrations.

The 22.1 release included the first part of a two-step storage engine
migration (see cockroachdb#77634) which marks files for compaction if they're a
member of an 'atomic compaction unit' within Pebble.

This metric will be useful when upgraading from 22.1 to 22.2 to verify
that zero files are marked for compaction before upgrading to 22.2, at
which point compacting the remaining marked files will block upgrade
finalization.

The metric is expected to be useful going forward for future migrations
(eg, deprecating support for range-del-v1 blocks) or monitoring the
progress of online encryption-at-rest key rotation (cockroachdb#74804).

Release note (ops change): Adds a new metric for monitoring storage-level
background migrations.
jbowens added a commit to jbowens/cockroach that referenced this pull request Mar 31, 2022
Add a timeseries metric for the count of files marked for compaction.
This metric isn't universally useful but it's expected to be useful as a
timeseries metric within specific contexts, particularly surrounding
storage-engine background migrations.

The 22.1 release included the first part of a two-step storage engine
migration (see cockroachdb#77634) which marks files for compaction if they're a
member of an 'atomic compaction unit' within Pebble.

This metric will be useful when upgraading from 22.1 to 22.2 to verify
that zero files are marked for compaction before upgrading to 22.2, at
which point compacting the remaining marked files will block upgrade
finalization.

The metric is expected to be useful going forward for future migrations
(eg, deprecating support for range-del-v1 blocks) or monitoring the
progress of online encryption-at-rest key rotation (cockroachdb#74804).

Release note (ops change): Adds a new metric for monitoring storage-level
background migrations.
jbowens added a commit to jbowens/cockroach that referenced this pull request Apr 1, 2022
Add a timeseries metric for the count of files marked for compaction.
This metric isn't universally useful but it's expected to be useful as a
timeseries metric within specific contexts, particularly surrounding
storage-engine background migrations.

The 22.1 release included the first part of a two-step storage engine
migration (see cockroachdb#77634) which marks files for compaction if they're a
member of an 'atomic compaction unit' within Pebble.

This metric will be useful when upgrading from 22.1 to 22.2 to verify
that zero files are marked for compaction before upgrading to 22.2, at
which point compacting the remaining marked files will block upgrade
finalization.

The metric is expected to be useful going forward for future migrations
(eg, deprecating support for range-del-v1 blocks) or monitoring the
progress of online encryption-at-rest key rotation (cockroachdb#74804).

Release note (ops change): Adds a new metric for monitoring storage-level
background migrations.
craig Bot pushed a commit that referenced this pull request Apr 4, 2022
78046: sql: Deduplication logic for `ALTER PRIMARY KEY` r=Xiang-Gu a=Xiang-Gu

When we use `ALTER PRIMARY KEY` to change the primary key of a table, a new
secondary index on the old primary key columns will be created. 
This PR added deduplication logic for `ALTER PRIMARY KEY` if there exists a unique,
non-partial secondary index that has the same columns as the (old) PK columns in
the same order with same direction.

Release note (sql change): `ALTER PRIMARY KEY` will not create a seconday index on 
the old PK columns if there is already a unique, non-partial secondary index that is
"identical" to the (old) PK columns. Two indexes are "identical" if they have exactly
the same columns, in the same order, with same direction.

Fixes: #74116

78523: kv/bulk: split at exiting key above ingested keys r=dt a=dt


If there is existing data above the span of an ingested SSTable, the
`AddSSTableResponse` now includes the key at which it starts. This can
be used by a caller to determine if and where it should split to avoid
its ingest span overlapping that existing data, since ingesting into an
empty span is generally ideal (we can scatter the empty RHS cheaply.)

This new field is then used by the sst batcher during ingest to split
off the existing data span if there is one above the file being added
any time we need to split to make room for a file. This ensures the span
into which that file is going is fully empty, and can be scattered.

Release note: none.

Jira issue: CRDB-14729

78978: ui: serve ETag header and respect If-None-Match req. header for assets r=[dhartunian,tbg] a=sjbarag

Reimplements changes from #78460 but doesn't perform hashing via `init()` to avoid panics reported (and fixed) in #78936

CockroachDB has included a "Cache-Control: no-cache" response header when serving static, embedded assets for several years now (dating back to as early as 2015 [1]), but offered no other way for clients to cache those. Since then, asset sizes have grown considerably larger (currently including ~30MB of JavaScript, a size that will be addressed via other methods) and preventing client-side caching causes noticeable loading delays. Add support for the If-None-Match / ETag pair of request/response headers [2], which allows browsers serve assets from their caches if the cached copy of a requested asset is still the latest copy.

[1] 5e8151f (Add support for snappy compression over http., 2015-04-07)
[2] https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-None-Match

Release note (performance improvement): Browser caching of files loaded in the admin UI is now supported.

79100: storage: add storage.marked-for-compaction-files metric r=nicktrav a=jbowens

Add a timeseries metric for the count of files marked for compaction.
This metric isn't universally useful but it's expected to be useful as a
timeseries metric within specific contexts, particularly surrounding
storage-engine background migrations.

The 22.1 release included the first part of a two-step storage engine
migration (see #77634) which marks files for compaction if they're a
member of an 'atomic compaction unit' within Pebble.

This metric will be useful when upgraading from 22.1 to 22.2 to verify
that zero files are marked for compaction before upgrading to 22.2, at
which point compacting the remaining marked files will block upgrade
finalization.

The metric is expected to be useful going forward for future migrations
(eg, deprecating support for range-del-v1 blocks) or monitoring the
progress of online encryption-at-rest key rotation (#74804).

Release note (ops change): Adds a new metric for monitoring storage-level
background migrations.

79146: tests: make some tests deterministic r=yuzefovich a=yuzefovich

This commit adds ORDER BY clauses to queries or `rowsort` directives in
tests in order to make the tests deterministic when the queries spill to
disk. Note that `rowsort` directives couldn't work in cases when I used
ORDER BY because in those cases the output values consist of multiple
words with a space as a delimiter, so `rowsort` trips up.

Touches: #77645.

Release note: None

79161: sql, geo: check infinite coordinates in st_minimumboundingcircle and st_linemerge r=ZhouXing19 a=ZhouXing19

This commit adds a check to determine if the bounding box of a Geometry has
any infinite coordinate in st_minimumboundingcircle and st_linemerge.

Fixes #75305
Fixes #74445

Release note: None

79252: colflow: fix execution time stats collection when an error occurs r=yuzefovich a=yuzefovich

This commit makes sure that we stop the stopwatches used to get the
execution time of an operator even if an error is encountered.

There is no regression test since this is quite painful to check. If we
don't collect the bundle, then the query returns an error and we don't
see the execution stats. If we do collect the bundle, then we'd need to
examine its contents. I did quick manual test to confirm that it works
as expected.

Release note (bug fix): Previously, the execution time as reported on
DISTSQL diagrams within the statement bundle collected via EXPLAIN
ANALYZE (DEBUG) could become negative when the statement encountered an
error. This is now fixed.

79349: cloudimpl: fallback to Size() when ContentLength is missing r=dt a=msbutler

Release note: none

Jira issue: CRDB-14733

Co-authored-by: Xiang Gu <xiang@cockroachlabs.com>
Co-authored-by: David Taylor <tinystatemachine@gmail.com>
Co-authored-by: Sean Barag <barag@cockroachlabs.com>
Co-authored-by: Jackson Owens <jackson@cockroachlabs.com>
Co-authored-by: Yahor Yuzefovich <yahor@cockroachlabs.com>
Co-authored-by: Jane Xing <zhouxing@uchicago.edu>
Co-authored-by: Michael Butler <butler@cockroachlabs.com>
blathers-crl Bot pushed a commit that referenced this pull request Apr 4, 2022
Add a timeseries metric for the count of files marked for compaction.
This metric isn't universally useful but it's expected to be useful as a
timeseries metric within specific contexts, particularly surrounding
storage-engine background migrations.

The 22.1 release included the first part of a two-step storage engine
migration (see #77634) which marks files for compaction if they're a
member of an 'atomic compaction unit' within Pebble.

This metric will be useful when upgrading from 22.1 to 22.2 to verify
that zero files are marked for compaction before upgrading to 22.2, at
which point compacting the remaining marked files will block upgrade
finalization.

The metric is expected to be useful going forward for future migrations
(eg, deprecating support for range-del-v1 blocks) or monitoring the
progress of online encryption-at-rest key rotation (#74804).

Release note (ops change): Adds a new metric for monitoring storage-level
background migrations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants