-
Notifications
You must be signed in to change notification settings - Fork 76
FR: zbox::Repo::ongoing_transaction
#70
Comments
Do you any special use cases for this request? Currently, all transactions are managed internally and they are not visible for application. I don't think there any necessity to expose it because transactions are tightly coupled with internal components and they are critical, app should not be able to control it. Read-only visibility doesn't help either, app cannot do anything even it knows what transactions are on-going. The transaction information will be hard to interpret as it contains the internal objects information inside that transaction, such as Fnode, Store, Segment, Content and etc. Also, how the application call |
This is no the information I expect to see about transaction. Is pathname of a file being written and number of unfinished bytes available somewhere? Initially
Main use case is to check if some transaction is ongoing before deciding to write a file. Or is ZboxFS supposed to be only used one file at a time? |
This abstraction becomes leaky as soon as user tries to do anything tricky with multiple files or multiple extends within a file. Correct usage of |
No, pathname is not in the transaction and there is no unfinished bytes. Thinking of writing as streaming, there is no way for ZboxFS to know if there any unfinished bytes.
ZboxFS supports multiple threads and you can operate on multiple files at same time but not on same file at same time. Thinking of each |
That's what ZboxFS trys to achieve, to prevent all that 'tricky' things you can do in traditional file system. ZboxFS implements ACID transaction in the whole file system, because one of its goals is to store data reliably. App developer should bear in mind this, and I think that is good actually because transaction is a relief for developer as it grantees data integrity and persistence. App developers just need to think it differently other than from traditional perspective. |
ZboxFS seems to think in terms of transactions. There are transaction-related error cases in
zbox::Error
, there are limitations based on transactions (e.g. inability to write multiple files in parallel), but there is few things about transaction available in API.If transactions are repository-wide (not file-scoped), I suggest to add something like
fn ongoing_transaction(&self) -> Option<TransactionInfo>;
inzbox::Repo
, which should tell if a transaction is ongoing. Additional information like number of uncommitted bytes, affected file or datetime may be provided inTransactionInfo
.The text was updated successfully, but these errors were encountered: