-
Notifications
You must be signed in to change notification settings - Fork 9
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
truncate does not exist for nfsrods #178
Comments
This is going to depend on how nfs4j uses the VFS implementation to achieve truncation. The NFSRODS VFS implementation as of today does not provide any direct truncation operations, therefore the results you're seeing are expected because the See the following. irods_client_nfsrods/irods-vfs-impl/src/main/java/org/irods/nfsrods/vfs/IRODSVirtualFileSystem.java Lines 1383 to 1437 in 8c686ca
Is the sequence of operations required for what you're trying to achieve? |
We are implementing nfsrods mounts that are accessed by applications that do things like this. We ran into this with VS Code Server when a file is made shorter from within the editor then the original contents remain after saving (at the end of the file) |
Sure. We'll investigate as soon as we can. |
thank you! |
So I had a thought and maybe this should be sent to the mailing list, but we are just trying to provide a mount for multiple users (not a single user or we could have used the fuse module), but if there is another approach we are open to ideas. |
It really depends on what your users need. If your users are running shell scripts, then NFSRODS is the right tool (at this time). We may be able to add support for truncation by modifying the following. irods_client_nfsrods/irods-vfs-impl/src/main/java/org/irods/nfsrods/vfs/IRODSVirtualFileSystem.java Lines 1356 to 1374 in 8c686ca
I believe we originally supported truncation, but it was removed for some reason. I'm going to see if I can track that down. Perhaps it can be supported with recent versions of iRODS. I'll let you know what I find. |
It looks like the initial release of nfsrods 0.8.0 had code for it (line 626) |
I believe the challenge with that implementation of truncate was that it was slow. The best solution is to add native support for truncation to the iRODS server. Obviously that doesn't help you today, but it would in the long run. Until we have native support in the iRODS server, I believe your only option with NFSRODS is to remove the data object before writing. Alternatively, you introduce a second tool/GUI that users can use for those cases which NFSRODS cannot handle (yet). |
makes sense thx. |
So we took the truncate code from 0.8.0 and put it in the latest and it does seem to fix the truncate cases, it does seem slow, but only seems slow for things that would otherwise be broken (with not very scientific tests). Do you recall any cases where it impacted non-truncate needed code? (We still agree that it should be in the core of iRODS), just not sure if you want us to push our pulling it forward? |
One thing that may matter to you is that implementation will result in the data id changing. If you rely on consistent data ids, then you're going to run into problems. Also, if you're running the latest version of NFSRODS, remember that it caches various pieces of information about data objects, etc. You'll need to think through if any of the caches need to be cleared for the data object being truncated. I suspect you'll need to remove the cached Please make sure to test things before deploying to production. Other than that, feel free to modify your clone as you see fit. We'll look into adding support for truncate to the iRODS server in a later release. Most likely 4.3.2. |
We are only deploying at the POC stage, this project won't go prod until after 4.3.2 I imagine, but thank you for the heads up on those items. |
Got it. Let us know how it goes. |
example to reproduce:
$echo hello, world > file
$echo goodbye > file
$cat file
goodbye
orld
The text was updated successfully, but these errors were encountered: