Skip to content

Commit

Permalink
[#205] Add iRODS server version check to resize operation.
Browse files Browse the repository at this point in the history
If NFSRODS detects that the iRODS server does not support the replica
truncate API, NFSRODS will throw an exception.
  • Loading branch information
korydraughn committed May 21, 2024
1 parent 9ac3a1b commit ec7b053
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ A user can set permissions via `nfs4_setfacl` on a collection or data object if
## Notes
- `chmod` is currently implemented as a `NOP` and will return `0`.
- NFSRODS currently reports disk free (`df -a`) as `0` to avoid being misleading to other programs.
- Resizing data objects requires iRODS 4.3.2 or later.

## Limitations
### Limitation 1: Write operations do not trigger replication on a replication resource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1405,6 +1405,11 @@ public void setattr(Inode _inode, Stat _stat) throws IOException

try
{
if (!factory_.getIRODSServerProperties(acct).isAtLeastIrods432())
{
throw new IOException("iRODS server does not support rc_replica_truncate API. Requires iRODS 4.3.2 or later.");
}

final var path = getPath(toInodeNumber(_inode));
log_.debug("setattr - Setting data size of [{}] to [{}] bytes.", path.toString(), _stat.getSize());
factory_.getDataObjectAO(acct).truncateReplica(path.toString(), _stat.getSize());
Expand Down

0 comments on commit ec7b053

Please sign in to comment.