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

db: add ViaBackingFileDownload option to DownloadSpan #3239

Closed
wants to merge 2 commits into from

Conversation

dt
Copy link
Member

@dt dt commented Jan 22, 2024

No description provided.

@dt dt requested review from itsbilal and RaduBerinde January 22, 2024 20:33
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@dt
Copy link
Member Author

dt commented Jan 22, 2024

There's some additional work to do here as discussed offline, but wanted to throw this up in case it is useful and/or if we want to merge it in a disabled state so that the CRDB-side or limiter etc work can be unblocked and then we come back to add the de-dupe and robust tests.

Copy link
Member

@RaduBerinde RaduBerinde left a comment

Choose a reason for hiding this comment

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

Left some comments. Like we discussed, it's ok to merge this for now even if we decide to switch to a provider-based operation later.

Reviewable status: 0 of 3 files reviewed, 2 unresolved discussions (waiting on @dt and @itsbilal)


compaction.go line 2759 at r1 (raw file):

	}
	metaCopy.FileNum = d.mu.versions.getNextFileNum()
	metaCopy.Virtual = false

This is hacky, we should do

if metaCopy.Virtual {
  // Even though this will be a virtual SST, we use the same number for the FileNum and the backing DiskFileNum.
  metaCopy.InitProviderBacking(base.DiskFileNum(metaCopy.FileNum))
} else {
  metaCopy.InitPhysicalBacking()
}

compaction.go line 2811 at r1 (raw file):

				n := min(size-pos, int64(len(buf)))
				readErr := r.ReadAt(context.TODO(), buf, pos)
				if readErr != nil && readErr != io.EOF {

io.EOF isn't an ok error here, if we got the size wrong we'd be writing garbage at the end

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