Milestone 1 Released
Milestone 1 of sia_nfs, the first public release, is now available!
This version is considered a preview, although it provides the expected functionality of an NFS gateway:
- Multi-Bucket Support: One or more buckets can be made available for a unified file system.
- Mounting and Unmounting: Mounting and unmounting works as expected.
- Directory Listing: Files and directories can be listed and navigated.
- Directory Creation: New empty directories can be created.
- Directory Removal: Empty directories can be deleted.
- File Deletion: Files can be deleted.
- Renaming and Moving: Files and directories can be renamed and moved (within the same bucket).
- File Reading: Files can be read as expected, including seeking.
- File Writing: New files can be created and written to, including copying an existing file.
As mentioned in the previous update, partial writing (e.g., editing an existing file) is NOT supported. The reasons for this are explained in detail. However, if there is strong community support for this feature, it can be added. It would be disabled by default and would need to be enabled by the user, who should understand the associated costs.
Progress Since the Previous Update
In my previous update, I discussed the progress of sia_nfs, including certain decisions, tradeoffs, and challenges encountered.
One significant aspect was how read and write operations are stateless, which presents certain challenges. I explained my approach and the solutions implemented, though they are not perfect.
Problem: Out-of-Order IO
As the project progressed, I learned more about the real-world access patterns encountered by sia_nfs. It turns out that not only read-ahead operations are problematic, but in practice, nearly all read and even write operations can arrive out-of-order.
The relatively simple approach (DownloadManager, UploadManager) previously used was not sufficient to handle this satisfactorily. Through a lengthy iterative process, I arrived at a more suitable solution:
Solution: IO Scheduler
I implemented a complex Scheduler capable of queuing and managing all ongoing IO operations while supporting multiple strategies—separate ones for reads and writes.
Efficient reading turned out to be a significantly more difficult problem to solve than writing. Implementing a good strategy for reading requires a fairly complete picture of what is, was, and probably will be happening.
This was more complex than anticipated and required an iterative approach, taking most of my time since the previous update. However, the Scheduler is now implemented and performs well. The write strategy was straightforward to implement and should require little work in the future. The read strategy works well for many usage patterns encountered so far, but some patterns are not handled ideally. More fine-tuning will be needed in the future as more usage patterns become apparent. Ultimately, this will always be a trade-off, and no single perfect solution will exist for all usage patterns.
Test Drive
If you want to try it out, you can! I have included a Dockerfile and easy-to-follow instructions on how to get started. All you need is Docker and a reachable renterd instance. Use it at your own risk, and avoid using it with important data for now.
Onward
Overall project progress has been good, and the current trajectory suggests that the next release will also be on time. The main functionality is here, and the focus in the coming weeks will be on stabilizing, testing, fine-tuning, and even more testing. Metadata caching is still missing, but I do not anticipate it to take much work to implement. I expect the next release to be generally usable.
Feedback
I invite everyone interested in sia_nfs to give it a try and post feedback in this thread. I am particularly interested in hearing about experiences with non-Linux NFS clients.