irods / irods_rule_engine_plugin_logical_quotas

BSD 3-Clause "New" or "Revised" License
1 stars 9 forks source link

Support of stream operations #86

Open iychoi opened 1 year ago

iychoi commented 1 year ago

As mentioned in the REAME, there's a limitation in supporting stream operations. However, can you reconsider implementing it for following reasons?

The libraries written in various languages (other than C/C++) use stream operations. For example, python-irodsclient and go-irodsclient implements parallel data upload and download based on stream operations. Many tools implemented using the libraries will have the same limitation in following logical quotas.

trel commented 1 year ago

From the README:

These changes have the following effects:

  • The plugin allows stream-based writes to violate the maximum bytes quota once.
  • Subsequent stream-based creates and writes will be denied until the quotas are out of violation.

The limitation you're talking about is the first bullet -- that any stream operation can go past the quota once?

We don't have a good implementation option available to track and prevent that initial quota violation. Can discuss more, but the options we discussed at the time were all messy and hard and slow.

iychoi commented 1 year ago

Yes, I am referring the first bullet.

Will it be hard to raise an error when closing a file opened if it violated the maximum bytes quota? I agree that it will be slow and inefficient checking the violation every time user writes.

trel commented 1 year ago

Well, we could definitely do the math and throw an error... but then... do what with the object? or the data? It's already been written.

I think we worked out our options were... a) we prevent it ahead of time, which is hard/impossible because we don't know how much more is coming, or b) we track every byte, which is very slow and hard to coordinate with other possible writers, or c) we throw error at the end (like you suggest), or d) we let one stream go past the quota and update the stats (the current implementation).