Skip to content

refactor: deprecate worker daemonset handling logic#5352

Merged
fluid-e2e-bot[bot] merged 5 commits into
fluid-cloudnative:masterfrom
TrafalgarZZZ:deprecated/remove_backward_compatible_logic_for_worker_ds
Nov 20, 2025
Merged

refactor: deprecate worker daemonset handling logic#5352
fluid-e2e-bot[bot] merged 5 commits into
fluid-cloudnative:masterfrom
TrafalgarZZZ:deprecated/remove_backward_compatible_logic_for_worker_ds

Conversation

@TrafalgarZZZ
Copy link
Copy Markdown
Member

Ⅰ. Describe what this PR does

Runtime worker daemonset has been deprecated since Fluid v0.7.0. It has been long enough to safely remove the logic for backward compatibility. This PR removes it to simplify code

  • Remove deprecated mode checks and related code from various components
  • Delete IsDeprecated function from errors package
  • Update worker setup and status check functions to handle errors consistently

Ⅱ. Does this pull request fix one issue?

NONE

Ⅲ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

- Remove deprecated mode checks and related code from various components
- Delete IsDeprecated function from errors package
- Update worker setup and status check functions to handle errors consistently

Signed-off-by: TzZtzt <trafalgarz@outlook.com>
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @TrafalgarZZZ, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refactors the Fluid project by eliminating the deprecated worker DaemonSet handling logic. Since worker DaemonSets were deprecated in Fluid v0.7.0, this change removes outdated compatibility checks and error handling mechanisms across the codebase, resulting in a more streamlined and maintainable system. The focus is on simplifying the code by removing components that are no longer supported or necessary, thereby reducing complexity and potential for future issues related to legacy code paths.

Highlights

  • Deprecation of Worker DaemonSet Logic: The pull request removes all handling logic for runtime worker DaemonSets, which have been deprecated since Fluid v0.7.0, simplifying the codebase.
  • Removal of Deprecated Error Checks: Deprecated mode checks and related error handling logic, specifically fluiderrs.IsDeprecated, have been removed from various components, including worker setup, status checks, and replica synchronization functions across multiple DDC engines (Alluxio, GooseFS, Jindo, JindoCache, JindoFSx, JuiceFS, Vineyard).
  • Code Simplification and Cleanup: Imports for fluiderrs and related Kubernetes API error types (apierrs, schema) that were previously used for deprecated DaemonSet checks have been removed, leading to cleaner and more focused code in pkg/ctrl/worker.go and various DDC engine files.
  • Test Case Updates: Unit tests related to deprecated DaemonSet error handling have been removed or updated to reflect the removal of this legacy logic, specifically in pkg/ctrl/worker_test.go and pkg/errors/errors_test.go.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request effectively removes the deprecated worker daemonset handling logic, which simplifies the codebase significantly. The changes are consistent across all affected components, and the removal of fluiderrs.IsDeprecated checks cleans up the error handling paths.

Notably, this refactoring also fixed a potential nil pointer dereference bug in pkg/ddc/goosefs/status.go where an error from GetWorkersAsStatefulset was not being properly handled, which could lead to a panic.

I have one suggestion regarding potentially unused code that was modified as part of this refactoring. Other than that, the changes look good.

@TrafalgarZZZ
Copy link
Copy Markdown
Member Author

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request effectively removes the deprecated logic for handling worker daemonsets, which simplifies the codebase and improves maintainability. The changes are mostly about removing the now-unused IsDeprecated error checks and associated code. My review found a couple of minor issues: an outdated comment and an unused function that should also be removed for consistency. Overall, this is a good cleanup effort.

Comment thread pkg/ctrl/worker.go
Comment on lines 39 to 40
// GetWorkersAsStatefulset gets workers as statefulset object. if it returns deprecated errors, it indicates that
// not support anymore.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The function comment is now outdated as the logic for handling deprecated DaemonSet workers has been removed. The function no longer returns deprecated errors. The comment should be updated to reflect its current functionality.

Suggested change
// GetWorkersAsStatefulset gets workers as statefulset object. if it returns deprecated errors, it indicates that
// not support anymore.
// GetWorkersAsStatefulset gets workers as a statefulset object.

Signed-off-by: TzZtzt <trafalgarz@outlook.com>
Signed-off-by: TzZtzt <trafalgarz@outlook.com>
Signed-off-by: TzZtzt <trafalgarz@outlook.com>
Signed-off-by: TzZtzt <trafalgarz@outlook.com>
@sonarqubecloud
Copy link
Copy Markdown

@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.85%. Comparing base (86fa687) to head (ab4f849).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5352      +/-   ##
==========================================
- Coverage   56.96%   56.85%   -0.12%     
==========================================
  Files         442      442              
  Lines       30529    30461      -68     
==========================================
- Hits        17391    17318      -73     
- Misses      11522    11527       +5     
  Partials     1616     1616              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR removes deprecated worker daemonset handling logic that was deprecated since Fluid v0.7.0. The changes simplify the codebase by removing backward compatibility code that is no longer needed.

  • Removes IsDeprecated error checking throughout the codebase
  • Deletes deprecated mode test cases across all runtime engines
  • Simplifies error handling by removing special cases for deprecated daemonset workers

Reviewed Changes

Copilot reviewed 52 out of 52 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pkg/errors/deprecated.go Comments out the IsDeprecated function
pkg/errors/errors_test.go Removes tests for the deprecated error checking
pkg/ctrl/worker.go Simplifies GetWorkersAsStatefulset to only retrieve StatefulSet workers
pkg/ddc/*/worker.go Removes deprecated error checks from worker setup across all engines
pkg/ddc/*/status.go Removes deprecated error checks from status sync across all engines
pkg/ddc/*/replicas.go Removes deprecated error checks from replica sync across all engines
pkg/ddc/*/sync_runtime.go Removes deprecated error checks from runtime sync (juicefs, jindofsx, jindocache)
pkg/ddc//_test.go Removes deprecated test cases and test data across all engines
pkg/ddc/base/log_test.go Updates test to use conflict error instead of deprecated error
pkg/utils/dataset/lifecycle/node.go Removes deprecated error check from node lifecycle handling
Comments suppressed due to low confidence (3)

pkg/ddc/vineyard/replicas_test.go:1

  • Using break instead of continue will exit the entire test loop when the deprecated field is true. Since the deprecated field and test case have been removed, this code is now unreachable but should have used continue to skip only that iteration, not break the entire loop. However, since the deprecated test case is removed, this code block should also be removed entirely.
    pkg/ddc/goosefs/replicas_test.go:1
  • Using break instead of continue will exit the entire test loop when the deprecated field is true. Since the deprecated field and test case have been removed, this code is now unreachable but should have used continue to skip only that iteration, not break the entire loop. However, since the deprecated test case is removed, this code block should also be removed entirely.
/*

pkg/ddc/jindocache/replicas_test.go:1

  • This code block checks for a deprecated field that no longer exists in the test case struct (removed on line 278). This will cause a compilation error. The entire if block should be removed since there are no more deprecated test cases.
/*

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/errors/deprecated.go
Comment on lines +56 to +58
// func IsDeprecated(err error) (deprecated bool) {
// return ReasonForError(err) == StatusReasonDeprecated
// }
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

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

The IsDeprecated function should be completely removed rather than commented out. Since the PR is removing deprecated worker daemonset handling logic, and this function is no longer called anywhere in the codebase, leaving it as commented code reduces maintainability. Consider removing it entirely or documenting why it needs to be preserved as comments.

Copilot uses AI. Check for mistakes.
Comment thread pkg/ddc/goosefs/status.go
e.Log.Info("Warning: Deprecated mode is not support, so skip handling", "details", err)
return ready, nil
}
return ready, err
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

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

[nitpick] The error return statement is now missing a blank line before the closing brace on line 52. While this is a minor style issue, maintaining consistent spacing improves code readability. Consider adding a blank line after line 51 to match the pattern used elsewhere in the codebase.

Suggested change
return ready, err
return ready, err

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator

@cheyang cheyang left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@fluid-e2e-bot
Copy link
Copy Markdown

fluid-e2e-bot Bot commented Nov 20, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cheyang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@fluid-e2e-bot fluid-e2e-bot Bot merged commit 7d9f486 into fluid-cloudnative:master Nov 20, 2025
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants