Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(CSI-247): implement InterfaceGroup.GetRandomIpAddress() (#319)
### TL;DR Implemented random IP selection for NFS mounts and simplified mount reference counting. ### What changed? - Added a new `GetRandomIpAddress` method to the `InterfaceGroup` struct, which selects a random IP address from the available IPs. - Modified `GetNfsMountIp` to use the new `GetRandomIpAddress` method instead of `GetIpAddress`. - Removed reference counting logic from the `nfsMount` struct, including the `refCount` field and associated `lock`. - Simplified `incRef` and `decRef` methods to always perform mount and unmount operations, respectively. ### How to test? 1. Test the new `GetRandomIpAddress` method by calling it multiple times and verifying that different IPs are returned. 2. Verify that NFS mounts now use randomly selected IP addresses. 3. Test mounting and unmounting operations to ensure they work correctly without reference counting. 4. Check that concurrent mount operations are handled properly. ### Why make this change? - Random IP selection for NFS mounts improves load balancing across available IPs. - Simplifying the mount reference counting reduces complexity and potential race conditions. - These changes aim to enhance the reliability and performance of NFS mount operations in the system. --- feat(CSI-247): implement InterfaceGroup.GetRandomIpAddress() feat(CSI-247): optimize NFS by utilizing multiple targets
- Loading branch information