use new name for new format export dbs
Delete the old export dbs on upgrade. Testing this an exporting to a directory with both exporttree=yes and importtree=yes, it refused to let an interrupted export proceed after upgrade, with "unsafe to overwrite file". An import resolved the problem.
This commit is contained in:
parent
09241f17ed
commit
2f94b5419a
4 changed files with 22 additions and 14 deletions
|
@ -48,6 +48,7 @@ module Annex.Locations (
|
||||||
gitAnnexFsckResultsLog,
|
gitAnnexFsckResultsLog,
|
||||||
gitAnnexSmudgeLog,
|
gitAnnexSmudgeLog,
|
||||||
gitAnnexSmudgeLock,
|
gitAnnexSmudgeLock,
|
||||||
|
gitAnnexExportDir,
|
||||||
gitAnnexExportDbDir,
|
gitAnnexExportDbDir,
|
||||||
gitAnnexExportLock,
|
gitAnnexExportLock,
|
||||||
gitAnnexExportUpdateLock,
|
gitAnnexExportUpdateLock,
|
||||||
|
@ -329,7 +330,11 @@ gitAnnexFsckState u r = gitAnnexFsckDir u r </> "state"
|
||||||
|
|
||||||
{- Directory containing database used to record fsck info. -}
|
{- Directory containing database used to record fsck info. -}
|
||||||
gitAnnexFsckDbDir :: UUID -> Git.Repo -> FilePath
|
gitAnnexFsckDbDir :: UUID -> Git.Repo -> FilePath
|
||||||
gitAnnexFsckDbDir u r = gitAnnexFsckDir u r </> "db"
|
gitAnnexFsckDbDir u r = gitAnnexFsckDir u r </> "fsckdb"
|
||||||
|
|
||||||
|
{- Directory containing old database used to record fsck info. -}
|
||||||
|
gitAnnexFsckDbDirOld :: UUID -> Git.Repo -> FilePath
|
||||||
|
gitAnnexFsckDbDirOld u r = gitAnnexFsckDir u r </> "db"
|
||||||
|
|
||||||
{- Lock file for the fsck database. -}
|
{- Lock file for the fsck database. -}
|
||||||
gitAnnexFsckDbLock :: UUID -> Git.Repo -> FilePath
|
gitAnnexFsckDbLock :: UUID -> Git.Repo -> FilePath
|
||||||
|
@ -347,14 +352,14 @@ gitAnnexSmudgeLog r = gitAnnexDir r </> "smudge.log"
|
||||||
gitAnnexSmudgeLock :: Git.Repo -> FilePath
|
gitAnnexSmudgeLock :: Git.Repo -> FilePath
|
||||||
gitAnnexSmudgeLock r = gitAnnexDir r </> "smudge.lck"
|
gitAnnexSmudgeLock r = gitAnnexDir r </> "smudge.lck"
|
||||||
|
|
||||||
{- .git/annex/export/uuid/ is used to store information about
|
{- .git/annex/export/ is used to store information about
|
||||||
- exports to special remotes. -}
|
- exports to special remotes. -}
|
||||||
gitAnnexExportDir :: UUID -> Git.Repo -> FilePath
|
gitAnnexExportDir :: Git.Repo -> FilePath
|
||||||
gitAnnexExportDir u r = gitAnnexDir r </> "export" </> fromUUID u
|
gitAnnexExportDir r = gitAnnexDir r </> "export"
|
||||||
|
|
||||||
{- Directory containing database used to record export info. -}
|
{- Directory containing database used to record export info. -}
|
||||||
gitAnnexExportDbDir :: UUID -> Git.Repo -> FilePath
|
gitAnnexExportDbDir :: UUID -> Git.Repo -> FilePath
|
||||||
gitAnnexExportDbDir u r = gitAnnexExportDir u r </> "db"
|
gitAnnexExportDbDir u r = gitAnnexExportDir r </> fromUUID u </> "exportdb"
|
||||||
|
|
||||||
{- Lock file for export state for a special remote. -}
|
{- Lock file for export state for a special remote. -}
|
||||||
gitAnnexExportLock :: UUID -> Git.Repo -> FilePath
|
gitAnnexExportLock :: UUID -> Git.Repo -> FilePath
|
||||||
|
|
|
@ -13,7 +13,6 @@ import Annex.Common
|
||||||
import Annex.CatFile
|
import Annex.CatFile
|
||||||
import qualified Database.Keys
|
import qualified Database.Keys
|
||||||
import qualified Database.Keys.SQL
|
import qualified Database.Keys.SQL
|
||||||
import qualified Database.ContentIdentifier
|
|
||||||
import qualified Git.LsFiles as LsFiles
|
import qualified Git.LsFiles as LsFiles
|
||||||
import qualified Git
|
import qualified Git
|
||||||
import Git.FilePath
|
import Git.FilePath
|
||||||
|
@ -23,8 +22,6 @@ upgrade automatic = do
|
||||||
unless automatic $
|
unless automatic $
|
||||||
showAction "v7 to v8"
|
showAction "v7 to v8"
|
||||||
|
|
||||||
populateKeysDb
|
|
||||||
|
|
||||||
-- The fsck databases are not transitioned here; any running
|
-- The fsck databases are not transitioned here; any running
|
||||||
-- incremental fsck can continue to write to the old database.
|
-- incremental fsck can continue to write to the old database.
|
||||||
-- The next time an incremental fsck is started, it will delete the
|
-- The next time an incremental fsck is started, it will delete the
|
||||||
|
@ -36,6 +33,12 @@ upgrade automatic = do
|
||||||
removeOldDb gitAnnexContentIdentifierDbDirOld
|
removeOldDb gitAnnexContentIdentifierDbDirOld
|
||||||
liftIO . nukeFile =<< fromRepo gitAnnexContentIdentifierLockOld
|
liftIO . nukeFile =<< fromRepo gitAnnexContentIdentifierLockOld
|
||||||
|
|
||||||
|
-- The export databases are deleted here. The new databases
|
||||||
|
-- will be populated by the next thing that needs them, the same
|
||||||
|
-- way as they would be in a fresh clone.
|
||||||
|
removeOldDb gitAnnexExportDir
|
||||||
|
|
||||||
|
populateKeysDb
|
||||||
removeOldDb gitAnnexKeysDbOld
|
removeOldDb gitAnnexKeysDbOld
|
||||||
liftIO . nukeFile =<< fromRepo gitAnnexKeysDbIndexCacheOld
|
liftIO . nukeFile =<< fromRepo gitAnnexKeysDbIndexCacheOld
|
||||||
liftIO . nukeFile =<< fromRepo gitAnnexKeysDbLockOld
|
liftIO . nukeFile =<< fromRepo gitAnnexKeysDbLockOld
|
||||||
|
|
|
@ -115,8 +115,12 @@ remaining todo:
|
||||||
> clone being used to update the export. The clone can only learn
|
> clone being used to update the export. The clone can only learn
|
||||||
> export state from the log. It's supposed to recover from such
|
> export state from the log. It's supposed to recover from such
|
||||||
> situations, the next time an export is run, so should be ok.
|
> situations, the next time an export is run, so should be ok.
|
||||||
> But it might result in already exported files being re-uploaded,
|
>
|
||||||
> or other unncessary work.
|
> Testing this an exporting to a directory with both exporttree=yes and
|
||||||
|
> importtree=yes, it refused to let an interrupted export proceed after
|
||||||
|
> upgrade, with "unsafe to overwrite file". An import resolved the
|
||||||
|
> problem. Guess the problem is that the content idenfifier did not
|
||||||
|
> get recorded in the git-annex branch and the db value was lost on upgrade.
|
||||||
>
|
>
|
||||||
> * Keys (IKey, SFilePath, SInodeCache)
|
> * Keys (IKey, SFilePath, SInodeCache)
|
||||||
> Use scanUnlockedFiles to repopulate the Associated table.
|
> Use scanUnlockedFiles to repopulate the Associated table.
|
||||||
|
|
|
@ -56,10 +56,6 @@ v7 repositories are automatically upgraded to v8.
|
||||||
Some sqlite databases that git-annex uses were changed in v8 and have to be
|
Some sqlite databases that git-annex uses were changed in v8 and have to be
|
||||||
re-populated.
|
re-populated.
|
||||||
|
|
||||||
Any exports that were started in v7 and then interruped won't resume where
|
|
||||||
they left off after the v8 upgrade. Some unncessary file uploads can
|
|
||||||
happen in this situation.
|
|
||||||
|
|
||||||
Any incremental fscks that were started in v7 won't resume where they left
|
Any incremental fscks that were started in v7 won't resume where they left
|
||||||
off in v8, but will instead begin again from the first file.
|
off in v8, but will instead begin again from the first file.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue