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

[Enhancement] Check volume name and mount path when default volume is added #464

Conversation

yandongxiao
Copy link
Collaborator

@yandongxiao yandongxiao commented Mar 11, 2024

Current Issues

In versions prior to v1.9.0, the following configuration could be successfully deployed.

When a user's FE configuration is as follows:

   storageVolumes:
      - mountPath: /opt/starrocks/fe/
        name: fe-meta
        storageClassName: pd-ssd
        storageSize: 200Gi
      - mountPath: /opt/starrocks/fe/log
        name: fe-log
        storageClassName: pd-ssd
        storageSize: 30Gi
      - mountPath: /tmp
        name: tmp-data
        storageClassName: emptyDir

The Operator checks the mountPath and finds that /opt/starrocks/fe/meta does not exist. Therefore, when creating the Statefulset object, an additional fe-meta configuration was added.

        volumeMounts:
        - mountPath: /opt/starrocks/fe/
          name: fe-meta
        - mountPath: /opt/starrocks/fe/log
          name: fe-log
        - mountPath: /tmp
          name: tmp-data
        - mountPath: /opt/starrocks/fe/meta  
          name: fe-meta         # duplicate mount name
        - mountPath: /etc/starrocks/fe/conf
          name: kube-starrocks-fe-cm

      volumes:
      - name: fe-meta
        persistentVolumeClaim:
          claimName: fe-meta
      - name: fe-log
        persistentVolumeClaim:
          claimName: fe-log
      - emptyDir: {}
        name: tmp-data
      - emptyDir: {}
        name: fe-meta   # duplicate volume
      - configMap:
          defaultMode: 420
          name: kube-starrocks-fe-cm
        name: kube-starrocks-fe-cm

The above statefulset configuration can be deployed.

After version 1.9.1, it will check if there is a conflict in the volume name, and the deployment above will fail.

Solution

The key issue is that the Operator currently only relies on the mountpath to determine whether to add a default volume. It should also consider both the volume name and mount path as criteria for adding a default volume.

@yandongxiao yandongxiao force-pushed the enhancement/check-volume-name-and-mount-path-when-default-volume-is-added branch from 383be0f to 5551249 Compare March 12, 2024 07:31
@yandongxiao yandongxiao force-pushed the enhancement/check-volume-name-and-mount-path-when-default-volume-is-added branch from 5551249 to 9ccc1db Compare March 12, 2024 07:49
@yandongxiao yandongxiao marked this pull request as ready for review March 12, 2024 07:49
@yandongxiao yandongxiao merged commit 6b84356 into StarRocks:main Mar 12, 2024
6 checks passed
@yandongxiao yandongxiao added v1.9.4 enhancement New feature or request labels Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request v1.9.4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants