-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix(jindo): fall back to dataset mounts when DataLoad has no target #6156
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
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 |
|---|---|---|
|
|
@@ -160,13 +160,27 @@ func (e *JindoEngine) genDataLoadValue(image string, runtime *datav1alpha1.Jindo | |
| } | ||
|
|
||
| targetPaths := []cdataload.TargetPath{} | ||
| for _, target := range dataload.Spec.Target { | ||
| fluidNative := utils.IsTargetPathUnderFluidNativeMounts(target.Path, *targetDataset) | ||
| targetPaths = append(targetPaths, cdataload.TargetPath{ | ||
| Path: target.Path, | ||
| Replicas: target.Replicas, | ||
| FluidNative: fluidNative, | ||
| }) | ||
| if len(dataload.Spec.Target) > 0 { | ||
| for _, target := range dataload.Spec.Target { | ||
| fluidNative := utils.IsTargetPathUnderFluidNativeMounts(target.Path, *targetDataset) | ||
| targetPaths = append(targetPaths, cdataload.TargetPath{ | ||
| Path: target.Path, | ||
| Replicas: target.Replicas, | ||
| FluidNative: fluidNative, | ||
| }) | ||
| } | ||
| } else { | ||
| // No explicit target is specified, fall back to loading all mount points of the dataset, | ||
| // otherwise the generated targetPaths would be empty and the dataload would be a no-op. | ||
|
Collaborator
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. This premise doesn't hold for this engine, so the change is solving a problem that isn't present here.
I rendered the real chart both ways to check: So a no-target Jindo DataLoad already loads the whole dataset here, and the generated #4439 describes something different, though: a DataLoad pod that failed, not one that loaded nothing. I think the chart default is still the right thing to suspect there, but on jindocache rather than on this engine. See the review body for that reasoning. |
||
| for _, mount := range targetDataset.Spec.Mounts { | ||
| path := utils.UFSPathBuilder{}.GenUFSPathInUnifiedNamespace(mount) | ||
|
Collaborator
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. The paths this derives aren't addressable in the JindoFS namespace, so the change turns a working DataLoad into a failing one.
The generated job runs the script from charts/fluid-dataloader/jindo/templates/configmap.yaml, whose The one shape where this is harmless is a single mount with If you want an explicit default here instead of relying on the chart, a single The per-mount idea itself is more defensible in jindocache, which builds one cacheset per mount rather than a single namespace. If #4439 is what you're targeting, that is where this change belongs. |
||
| fluidNative := utils.IsTargetPathUnderFluidNativeMounts(path, *targetDataset) | ||
| targetPaths = append(targetPaths, cdataload.TargetPath{ | ||
| Path: path, | ||
| Replicas: 1, | ||
|
Collaborator
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. nit: |
||
| FluidNative: fluidNative, | ||
| }) | ||
| } | ||
| } | ||
| dataloadInfo.TargetPaths = targetPaths | ||
| options := map[string]string{} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -546,6 +546,89 @@ func Test_genDataLoadValue(t *testing.T) { | |
| }, | ||
| }, | ||
| }, | ||
| "test case with multiple mounts and no explicit target": { | ||
| image: "fluid:v0.0.1", | ||
| targetDataset: &datav1alpha1.Dataset{ | ||
| ObjectMeta: metav1.ObjectMeta{ | ||
| Name: "test-dataset", | ||
| Namespace: "fluid", | ||
| }, | ||
| Spec: datav1alpha1.DatasetSpec{ | ||
| Mounts: []datav1alpha1.Mount{ | ||
| { | ||
| Name: "spark", | ||
| MountPoint: "local://mnt/data0", | ||
| Path: "/mnt0", | ||
|
Collaborator
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. Both fixtures set an absolute I checked by mutation: replacing The A case that asserts the rendered |
||
| }, | ||
| { | ||
| Name: "hive", | ||
| MountPoint: "local://mnt/data1", | ||
| Path: "/mnt1", | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| dataload: &datav1alpha1.DataLoad{ | ||
| ObjectMeta: metav1.ObjectMeta{ | ||
| Name: "test-dataload", | ||
| Namespace: "fluid", | ||
| }, | ||
| Spec: datav1alpha1.DataLoadSpec{ | ||
| Dataset: datav1alpha1.TargetDataset{ | ||
| Name: "test-dataset", | ||
| Namespace: "fluid", | ||
| }, | ||
| SchedulerName: "scheduler-test", | ||
| }, | ||
| }, | ||
| runtime: &datav1alpha1.JindoRuntime{ | ||
| Spec: datav1alpha1.JindoRuntimeSpec{ | ||
| TieredStore: datav1alpha1.TieredStore{ | ||
| Levels: []datav1alpha1.Level{ | ||
| { | ||
| MediumType: "MEM", | ||
| }, | ||
| }, | ||
| }, | ||
| HadoopConfig: "principal=root", | ||
| }, | ||
| }, | ||
| want: &cdataload.DataLoadValue{ | ||
| Name: "test-dataload", | ||
| OwnerDatasetId: "fluid-test-dataset", | ||
| Owner: &common.OwnerReference{ | ||
| Kind: "DataLoad", | ||
| APIVersion: "data.fluid.io/v1alpha1", | ||
| Enabled: true, | ||
| Name: "test-dataload", | ||
| BlockOwnerDeletion: false, | ||
| Controller: true, | ||
| }, | ||
| DataLoadInfo: cdataload.DataLoadInfo{ | ||
| BackoffLimit: 3, | ||
| Image: "fluid:v0.0.1", | ||
| TargetDataset: "test-dataset", | ||
| SchedulerName: "scheduler-test", | ||
| TargetPaths: []cdataload.TargetPath{ | ||
| { | ||
| Path: "/mnt0", | ||
| Replicas: 1, | ||
| FluidNative: true, | ||
| }, | ||
| { | ||
| Path: "/mnt1", | ||
| Replicas: 1, | ||
| FluidNative: true, | ||
| }, | ||
| }, | ||
| ImagePullSecrets: []corev1.LocalObjectReference{}, | ||
| Options: map[string]string{ | ||
| "loadMemorydata": "true", | ||
| "hdfsConfig": "principal=root", | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| } | ||
| engine := JindoEngine{ | ||
| namespace: "fluid", | ||
|
|
||
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.
fixes #4439doesn't hold with this scope, so the issue would stay broken after merge.That report is about a
JindoRuntime, andGetDefaultEngineImpl()(pkg/utils/jindo/jindo.go:37) returnsjindocacheunless the operator runs withJINDO_ENGINE_TYPE=jindoorjindofsx.pkg/ddc/jindois the legacy JindoFS engine on smartdata:3.8.0, so a default install never executes this branch. jindocache and jindofsx carry the same empty-target shape in their own load_data.go.I understand wanting to keep the diff minimal and scoped, and normally I'd agree. Here the scope is what makes the change unable to affect the environment in the report.
Either retarget the change to jindocache, or drop
fixes #4439from the description so the issue doesn't get auto-closed by a change that cannot affect it.