-
Notifications
You must be signed in to change notification settings - Fork 260
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
Always use scratchspace when importing and converting #2832
Changes from all commits
1210cc1
6927bc9
b140bb8
9496558
06dec15
ba11540
5186dcd
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 |
---|---|---|
|
@@ -130,20 +130,13 @@ func (hs *HTTPDataSource) Info() (ProcessingPhase, error) { | |
if hs.contentType == cdiv1.DataVolumeArchive { | ||
return ProcessingPhaseTransferDataDir, nil | ||
} | ||
if hs.readers.Convert { | ||
if hs.brokenForQemuImg || hs.readers.Archived || hs.customCA != "" { | ||
return ProcessingPhaseTransferScratch, nil | ||
} | ||
} else { | ||
if hs.readers.Archived || hs.customCA != "" { | ||
return ProcessingPhaseTransferDataFile, nil | ||
} | ||
} | ||
hs.url, _ = url.Parse(fmt.Sprintf("nbd+unix:///?socket=%s", nbdkitSocket)) | ||
if err = hs.n.StartNbdkit(hs.endpoint.String()); err != nil { | ||
return ProcessingPhaseError, err | ||
if !hs.readers.Convert { | ||
return ProcessingPhaseTransferDataFile, nil | ||
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 we can technically get rid No need to write a raw/iso to scratch, right? UNLESS we want to truly respect |
||
} | ||
return ProcessingPhaseConvert, nil | ||
// removing check for hs.brokenForQemuImg, and always assuming it is true | ||
// revert once we are able to get nbdkit 1.35.8, which contains a fix for the | ||
// slow download speed. | ||
return ProcessingPhaseTransferScratch, nil | ||
} | ||
|
||
// Transfer is called to transfer the data from the source to a scratch location. | ||
|
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.
given the current implementation isn't
preallocationApplied
always true?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.
Only if the DV has the preallocation flag set, the value of dp.preallocation will be true in that case, false otherwise
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 was mistaken when
preallocationApplied
should always be true. My understanding of the implementation in this PR is:preallocation
setting the disk will always be preallocated when not "converting" so raw, iso, etcI am wondering if case 1 above is accurately reflected in
dp.preallocationApplied
?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 am not sure I can know at this point in the code, this gets run for multiple different datasources, some of which may preallocate and some may not. I do know that if the flag was set on the importer pod, then the datasource would respect it, if it was not set, it may or may not have preallocated depending on the datsource.
Maybe we need to add something to the datasource API where the datasource can indicate it preallocated or not.