-
Notifications
You must be signed in to change notification settings - Fork 8
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
implementation for archiving a pack file #138
base: main
Are you sure you want to change the base?
Conversation
Archive packs needs special handling. 1. They should not be selected for writing 2. They can reside on different locations
This allow an archived pack to be imported into other containers, without the need of the SQLite database file.
Sometimes it is a string, sometimes it can be an int. sqlite does not seem to care? But matching inside python differentiate the two.
This allows archive files to exist outside of the container folder.
Allow archive locations to be set/updated, alow added CLI
Codecov Report
@@ Coverage Diff @@
## develop #138 +/- ##
===========================================
- Coverage 99.52% 97.07% -2.45%
===========================================
Files 8 8
Lines 1676 1881 +205
===========================================
+ Hits 1668 1826 +158
- Misses 8 55 +47
Continue to review full report at Codecov.
|
Hi @chrisjsewell @giovannipizzi, could you please take a look of this? Some prblems still to be solved:
|
Alow CompressMode.YES and CompressMode.NO to be used when repacking. Previously, there was no way to change compression once an object is stored in a packed file.
Replaces #133
Archived pack files are essentially ZIP archives. Reading from these files are also supported from offset/length as stored in the sqlite database. Because archived packs will never be used for reading, they can be stored at different file systems and networked locations. The use of ZIP archives also allows recovering data in case of the sqlite database being damaged.
The main difference between an archived pack and a normal pack is that:
Creating an archive is a slow process, and should be carried out while the container is not activet (e.g. similar to repack). However, I think it is should still be possible to carry out as long as the pack file being archived not being written into at the same time.
A new table is needed in the sqlite database to store the status of the pack file, with two extra columns:
state
andlocation
. The former would be changed toArchived
if the pack is archived. The latter stores any explicit location of the archived pack file.A cli interface is provided to list archive files and update their locations.