Skip to content
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

File creation transaction in DocumentController #7

Open
1 of 5 tasks
Hjorthen opened this issue Jan 15, 2018 · 0 comments
Open
1 of 5 tasks

File creation transaction in DocumentController #7

Hjorthen opened this issue Jan 15, 2018 · 0 comments
Labels

Comments

@Hjorthen
Copy link
Contributor

Hjorthen commented Jan 15, 2018

Currently files are stored before registering them in the database. It is possible to create a transaction, which makes sure that the database is consistent with the file system.

  • Write file to temp folder
  • Retrieve unique file name
  • Write unique name to database under a transaction
  • Move file to unique name from temp folder
  • Commit transaction

The only way that the store can become in an inconsistent state is if the commit of the transaction fails. A scheduling thread could periodically scan files in the file system and remove those which have no entry in the database.

@Hjorthen Hjorthen added the bug label Jan 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant