Skip to content

Conversation

@laik
Copy link

@laik laik commented Dec 10, 2025

This PR introduces a node-deployment mode for the OpenEBS Dynamic LocalPV
Provisioner, addressing performance bottlenecks identified in openebs/openebs#4050.

Key Changes:

  • New --node-deployment=true flag to run provisioner as DaemonSet on each node
  • Direct local volume operations (mkdir, quota, rm) without helper pods
  • Automatic node filtering using IgnoredError for proper multi-instance coordination
  • Leader election disabled in node-deployment mode

Benefits:

  • Eliminates helper pod creation/termination overhead
  • Reduces PVC binding latency significantly
  • Decreases API server load
  • Simpler architecture than external service approach

Solve xfs/ext projId Issues
Solve race conditions Issues

#289
#290

@laik laik requested a review from a team as a code owner December 10, 2025 13:43
Copy link
Member

@tiagolobocastro tiagolobocastro left a comment

Choose a reason for hiding this comment

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

Awesome, just a few questions!

Solve xfs/ext projId Issues

Could you fix this for the helperPod variant as well? And if we could share some of that code that would be great.

Solve race conditions Issues

Is this only solved in new daemonset mode?

base="%s"
# check fs type first
fs=$(stat -f -c %%T $base 2>/dev/null)
if [ "$fs" = "xfs" ]; then
Copy link
Member

Choose a reason for hiding this comment

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

Is nothing needed for ext4?

Copy link
Author

@laik laik Dec 11, 2025

Choose a reason for hiding this comment

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

Yes, I saw there will be some leftovers, I'll fix it

*** Report for project quotas on device /dev/loop0
Block grace time: 7days; Inode grace time: 7days
                        Block limits                File limits
Project         used    soft    hard  grace    used  soft  hard  grace
----------------------------------------------------------------------
#0        --      20       0       0              3     0     0       
#1        --       4  112640  122880              1     0     0       
#2        --       4  112640  122880              1     0     0       
#3        --       4  112640  122880              1     0     0       
#4        --       4  112640  122880              1     0     0       


➜  pv-test git:(main) ✗ km pod --all  && km pvc --all
...
➜  pv-test git:(main) ✗ repquota -P /root/openebs/local
*** Report for project quotas on device /dev/loop0
Block grace time: 7days; Inode grace time: 7days
                        Block limits                File limits
Project         used    soft    hard  grace    used  soft  hard  grace
----------------------------------------------------------------------
#0        --      20       0       0              3     0     0    


➜  pv-test git:(main) ✗ repquota -avugP

*** Report for project quotas on device /dev/loop0
Block grace time: 7days; Inode grace time: 7days
                        Block limits                File limits
Project         used    soft    hard  grace    used  soft  hard  grace
----------------------------------------------------------------------
#0        --      20       0       0              3     0     0       
#1        --       0  112640  122880              0     0     0       
#2        --       0  112640  122880              0     0     0       
#3        --       0  112640  122880              0     0     0       
#4        --       0  112640  122880              0     0     0       

Copy link
Author

Choose a reason for hiding this comment

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

Related issues #155

script := fmt.Sprintf(`
set -e
# Find the actual mount point for the path using host's mount info
Copy link
Member

Choose a reason for hiding this comment

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

Do we need this fix on the helper pod variant?

Copy link
Author

Choose a reason for hiding this comment

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

yeah, It will be fixed in the previous commit. I forgot to synchronize it when the commit was rolled back. I will fix it.

func (vm *LocalVolumeManager) applyQuotaByFilesystem(ctx context.Context, parentDir, volumeDir, softLimitGrace, hardLimitGrace string) error {
// Create a shell script to detect filesystem and apply quota
// We need to find the actual XFS mount point since parentDir might be a bind mount
script := fmt.Sprintf(`
Copy link
Member

Choose a reason for hiding this comment

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

Is there some way to share this with the helper pod variant?

Copy link
Author

Choose a reason for hiding this comment

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

This is not suitable for sharing

@tiagolobocastro
Copy link
Member

@laik please take a look at the test failure
Also probably should add a parallel test run with the daemonset mode?

Signed-off-by: laik <laik.lj@me.com>
@laik
Copy link
Author

laik commented Dec 11, 2025

@laik please take a look at the test failure Also probably should add a parallel test run with the daemonset mode?

ok , let me check

@laik
Copy link
Author

laik commented Dec 11, 2025

Awesome, just a few questions!

Solve xfs/ext projId Issues

Could you fix this for the helperPod variant as well? And if we could share some of that code that would be great.

Solve race conditions Issues

Is this only solved in new daemonset mode?

yeah, Helper pod belongs to the asynchronous mode at the pod level. If necessary, you may need to create a file to lock it.

@tiagolobocastro
Copy link
Member

yeah, Helper pod belongs to the asynchronous mode at the pod level. If necessary, you may need to create a file to lock it.

You mean using flock right? We used that on rawfile, so probably could also use it here.

@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 39.18%. Comparing base (cab53c4) to head (7d38c91).
⚠️ Report is 61 commits behind head on develop.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #306      +/-   ##
===========================================
+ Coverage    37.91%   39.18%   +1.26%     
===========================================
  Files           36        1      -35     
  Lines         3373      684    -2689     
===========================================
- Hits          1279      268    -1011     
+ Misses        2012      407    -1605     
+ Partials        82        9      -73     
Flag Coverage Δ
integrationtests 39.18% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@laik
Copy link
Author

laik commented Dec 12, 2025

yeah, Helper pod belongs to the asynchronous mode at the pod level. If necessary, you may need to create a file to lock it.

You mean using flock right? We used that on rawfile, so probably could also use it here.

Yes, I checked the documentation about flock and it should be possible.

Copy link
Member

@tiagolobocastro tiagolobocastro left a comment

Choose a reason for hiding this comment

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

@niladrih do we update the changelog here or would you update it on release?

config.taints = pOpts.selectedNodeTaints

config.pOpts.cmdsForPath = append(config.pOpts.cmdsForPath, filepath.Join("/data/", config.volumeDir))
// check if path is xfs quota enabled and remove quota projid
Copy link
Member

Choose a reason for hiding this comment

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

this is the fix for the non-distributed cleanup right? Could you place this on a separate commit?

setquota -P $ID 0 0 0 0 $base 2>/dev/null || true
fi
fi
rm -rf $d
Copy link
Member

Choose a reason for hiding this comment

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

Is there any safety check against this not being the base path for example?

Comment on lines +27 to +29
e2fsprogs \
xfsprogs \
xfsprogs-extra \
Copy link
Member

Choose a reason for hiding this comment

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

are all these required?

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