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

backup: always write to cloud storage in processor #68468

Merged
merged 7 commits into from
Aug 6, 2021

Conversation

dt
Copy link
Member

@dt dt commented Aug 5, 2021

Release note (sql change): the setting bulkio.backup.proxy_file_writes.enabled is no longer needed to enable proxied writes which are now the default.

Also, while I'm here, de-couple the target file size used by the processor (which streams its writes out to cloud storage) from the target file size of ExportRequest (which is now always in-memory, and twice over at that, on both the KV and SQL side of the RPC).

@dt dt requested review from pbardea, aliher1911, nvanbenschoten and a team August 5, 2021 13:26
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@dt
Copy link
Member Author

dt commented Aug 5, 2021

@pbardea should we also drop kv.bulk_sst.target_size to 8 or 16mb while we're at it?

@pbardea
Copy link
Contributor

pbardea commented Aug 5, 2021

should we also drop kv.bulk_sst.target_size to 8 or 16mb while we're at it?

Yep, that sounds reasonable. I would think that 16 MB should be small enough for a sane default?

Copy link
Member

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

@dt dt requested a review from a team as a code owner August 5, 2021 17:05
@dt
Copy link
Member Author

dt commented Aug 5, 2021

Some revisions here that probably deserve a re-review (sorry!):

  • I found an existing bug in progress reporting for returned SSTs fixed in what is now the first commit,
  • added some extra debug VEventf's, and
  • ripped out support for non-returned ssts from the processor's ExportResponse handling
  • bumped the default export target file size down to 16mb

Copy link
Contributor

@pbardea pbardea left a comment

Choose a reason for hiding this comment

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

Nice bug spotting! LGTM with nits

pkg/ccl/backupccl/backup_processor.go Outdated Show resolved Hide resolved
pkg/ccl/backupccl/backup_processor.go Outdated Show resolved Hide resolved
pkg/ccl/backupccl/backup_processor.go Show resolved Hide resolved
@dt dt force-pushed the return-sst branch 3 times, most recently from 3417466 to c6d79da Compare August 6, 2021 04:13
dt added 6 commits August 6, 2021 04:20
Locality-partitioned backups were intended to reduce cross-regional file writes.
Thus, if the processor is writing a file, it should do so to the region that matches
its locality. Due to PartitionSpans, this should generally be the same node and thus
same region as the leaseholder, or at least where the leaseholder was during planning.

Release note: none.
The BACKUP processor should pick its target file size -- at which it closes
a file and opens a new one -- independently from the KV's target Export file
size, which has factors like request duration, memory footprint, etc that may
influence it but are not relevant to the backup file as it is streamed our to
cloud storage.

Release note: none.
This removes the bulkio.backup.proxy_file_writes.enabled setting, and just
always does the behavior of it being true.

Release note (sql change): the setting bulkio.backup.proxy_file_writes.enabled is no longer needed to enable proxied writes which are now the default.
Copy link
Contributor

@aliher1911 aliher1911 left a comment

Choose a reason for hiding this comment

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

:lgtm:

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


pkg/ccl/backupccl/backup_processor.go, line 386 at r6 (raw file):

						FileSummaries: make([]RowCount, 0),
					}
					for i, file := range res.Files {

Maybe it is worth adding a comment that we always expect a single file here and loop is kept for historic reasons? I think there are few checks here like completedSpans below that give an impression that there could be more that a single entry so comment at least in one place could make it easier to understand.

With header.TargetBytes = 1 we expect each request to return at most one file,
but the loop, kept here for legacy reasons may suggest otherwise. Logging a warning
should help document what we expect while also informing us if we're mistaken.

Release note: none.
Copy link
Member Author

@dt dt left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 2 stale) (waiting on @aliher1911, @dt, and @nvanbenschoten)


pkg/ccl/backupccl/backup_processor.go, line 386 at r6 (raw file):

Previously, aliher1911 (Oleg) wrote…

Maybe it is worth adding a comment that we always expect a single file here and loop is kept for historic reasons? I think there are few checks here like completedSpans below that give an impression that there could be more that a single entry so comment at least in one place could make it easier to understand.

added a logged warning if len > 1 (figure that both documents expectation as a comment would, but also informs us if they're incorrect?)

@dt
Copy link
Member Author

dt commented Aug 6, 2021

TFTRs!

bors r+

@craig
Copy link
Contributor

craig bot commented Aug 6, 2021

Build succeeded:

@craig craig bot merged commit 6fafc56 into cockroachdb:master Aug 6, 2021
@dt dt deleted the return-sst branch August 7, 2021 12:21
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.

5 participants