summaryrefslogtreecommitdiff
path: root/lib/backupstore
Commit message (Collapse)AuthorAge
* Add QueryCreateDirectory2 command.Chris Wilson2014-03-02
| | | | | Allows creating a directory with a specified modtime (in the parent directory entry). Tests to come shortly.
* Make Protocol take control of the socket object passed in.Chris Wilson2014-03-01
| | | | | | | | | | | | | We pass a std::auto_ptr<SocketStream> to every Protocol subclass when we construct it, and it takes control of this object. This reduces the risk of: * accidentally reusing the same SocketStream for multiple Protocols (it happened to me in testbackupstore); * holding onto a reference to the SocketStream; * allowing a locally-scoped SocketStream to go out of scope and be released while still being referenced by a live Protocol.
* Don't throw a wobbly while backing up if files don't exist.Chris Wilson2014-02-27
| | | | | | | Reading extended attributes may fail with an error if the file was removed (race condition) or in tests when generating random nonexistent directory entries. Handle this more gracefully by not backing up the extended attributes instead of dying completely.
* Fix crash in BackupStoreContext with no HousekeepingInterface pointer.Chris Wilson2014-02-27
| | | | | | Rename mrDaemon to mpHousekeeping and make it a pointer, so that it can officially be NULL, and don't crash if it is, and we fail to get a lock on the account.
* Shorthand check for deleted flag.Chris Wilson2014-02-27
|
* Fix buggy directory deletion by housekeeping.Chris Wilson2014-02-27
| | | | Was introduced by commit bc8261347880b813af58c4b873e1847cca03778d.
* Allow read-only account check without taking a write lock on account.Chris Wilson2014-02-27
|
* Use the new test utilities to remove some duplicate code.Chris Wilson2014-02-27
| | | | Fix previous changes by waiting for forked bbstored process during termination.
* Move test utilities into a separate file, to share with testbbackupd.Chris Wilson2014-02-27
|
* Check that adding a new directory doesn't exceed store limits.Chris Wilson2014-02-13
|
* Add a shortcut interface to uploading a new file.Chris Wilson2014-02-13
| | | | Useful in tests.
* Add a convenience constructor to read a BackupStoreDirectory from a stream.Chris Wilson2014-02-13
| | | | Saves ~2 lines each time it's used. And we use it a lot in testbackupstore.
* Don't consider it an error if LastObjectIDUsed changes during check.Chris Wilson2014-02-11
| | | | | There could be many reasons for this, including an invalid object being deleted during the previous check run. And it's definitely not serious.
* Fix accounting for old and deleted files, and dirs removed by housekeeping.Chris Wilson2014-02-11
| | | | | Also pass the actual reference count of an object to RaidFileWrite instead of assuming that it's zero, to avoid accidentally deleting a referenced object.
* Fix accounting for old and deleted files and blocks during backup operations.Chris Wilson2014-02-10
| | | | Adding and deleting files was not always accounted properly before.
* Add a ClearDirectoryCache method to BackupStoreContext.Chris Wilson2014-02-10
| | | | It's used in several places, and about to be one more.
* Reformat for readability, add defensive comment.Chris Wilson2014-02-10
|
* Fix wrong output of client store marker in bbstoraccounts info.Chris Wilson2014-02-10
|
* Fix testbackupstore, apart from wrong accounting for old files.Chris Wilson2014-02-10
|
* Rename BackupStoreInfo variable NumFiles to NumCurrentFiles.Chris Wilson2014-02-09
| | | | | Will hopefully prevent future confusion about the meaning of this info variable.
* Fix wrong handling of objects with multiple references in housekeeping.Chris Wilson2014-02-09
| | | | | | We don't have a test for it yet, and won't until snapshots are implemented, but it's a bad idea to merge patches to remove an old version when another directory is still holding a reference to the patch.
* Fix accounting in bbstoreaccounts check.Chris Wilson2014-02-09
| | | | | | Fix accounting for current, old and deleted files and blocks. Previously there was confusion over the meaning of NumFiles, now it's defined to mean the number of current files (neither old nor deleted), similar to BlocksInCurrentFiles.
* The user asked us to fix errors, so it's not a very important notification ↵Chris Wilson2014-02-09
| | | | that we're doing so.
* Add new exception to denote a corrupt refcount db.Chris Wilson2014-02-07
|
* Fix compile error.Chris Wilson2014-02-07
| | | | | | | | | | Caused by removal of BackupStoreRefCountDatabase::CreateForRegeneration. It's not safe to do this in housekeeping anyway, because it might not complete the scan, leaving an incomplete database, that might persuade BackupStoreContext that it's OK to delete an object that still really has references to it. If your refcount db disappears or is damaged, you need to run a check fix.
* Create new refcount database atomically during account check.Chris Wilson2014-02-07
| | | | | | | | | | | Use a temporary refcount db for check instead of an in-memory vector. This avoid the memory usage problems created by using the vector on large accounts, but may require us to improve the efficiency of the refcount database itself to avoid large numbers of small I/O operations. That is very doable now that we're using a class for it. Fix some inconsistencies and mistakes in handling reference counts and info counters during account checks (more to come).
* Fix compile error.Chris Wilson2014-02-07
| | | | | Caused by premature switch from GetNumFiles to GetNumCurrentFiles.
* Add an AccountUsage2 command to backup protocol.Chris Wilson2014-02-07
| | | | | Allows us to get information about the account that's not available using the old AccountUsage command. Currently only used in tests.
* Move the comment to somewhere more useful.Chris Wilson2014-02-07
|
* Don't need to protect InvisibleTempFileStream against exceptions.Chris Wilson2014-02-07
| | | | | | | By definition, it will be cleared up by the OS automatically. Also we don't need to support gcc 2.x any more. It was replaced by gcc3 in 2001, 12 years ago.
* Revert "Revert "Fix compile error introduced by bbstoreaccounts refactor.""Chris Wilson2014-02-07
| | | | | | This reverts commit b3bc7ad5be2c5b2588793aaa9fbc05e4a1c0aea5. Should not have been applied in SVN (not just yet, anyway).
* Rename BackupStoreContext.GetStoreRoot() to GetAccountRoot().Chris Wilson2014-02-07
| | | | More accurate name for this variable.
* Revert "Fix compile error introduced by bbstoreaccounts refactor."Chris Wilson2014-02-07
| | | | This reverts commit 9d0580c58025ba94bee02cdc2aae3fe0b6ccf604.
* Fix compile error introduced by bbstoreaccounts refactor.Chris Wilson2014-02-07
|
* Add ReleaseWriteLock to BackupStoreContext.Chris Wilson2014-02-07
| | | | Not really an API, but useful for BackupProtocolLocal2.
* Add a BackupProtocolLocal2 convenience class.Chris Wilson2014-02-07
| | | | | Adds a nicer constructor and more helpful cleanup on QueryFinished() to the auto-generated BackupProtocolLocal.
* Split bbstoreaccounts commands out into a separate class.Chris Wilson2014-02-07
| | | | | Allows us to call them from tests without shelling out, making debugging easier.
* Files are allowed to be both Old and Deleted.Chris Wilson2013-10-02
| | | | Count them as Deleted, not as Old.
* Clang complains that numDelObj is not initialised.Chris Wilson2013-09-28
| | | | | | | I don't think this has any effect in practice, but this patch ensures that it is initialised anyway.
* Repair damaged Box RAID objects and non-transformed .rfw files.Chris Wilson2013-09-20
|
* Ensure that all errors that increment mNumberErrorsFound are reported as ↵Chris Wilson2013-09-19
| | | | | | | BOX_ERROR. Remove debugging code for Sune Molgaard's issue with non-existent files.
* Report everything that increases mNumberErrorsFound as a BOX_ERROR.Chris Wilson2013-09-19
|
* Add missing definition of CheckDirectory, fix CheckDirectoryEntry prototype.Chris Wilson2013-09-19
|
* Repeatedly "fix" directories until all errors are cleared.Chris Wilson2013-09-19
| | | | | | | Fixes some cases where a directory might refer to an object that doesn't exist, which is removed from the directory, but an object that depends on it (a patch) isn't removed, and requires a subsequent recheck.
* Fix missing include, thanks Arnaud.Chris Wilson2013-09-02
|
* Improve debugging messages after repairing a directory.Chris Wilson2013-08-22
| | | | | | | | | | | Report whether the directory still had errors after the first pass of dir.CheckAndFix(), and also whether a file is marked as both Old and Deleted, which means that its block usage is not accounted for anywhere. There's possibly still a bug here where an invalid directory entry that is itself a directory may not result in the parent directory being marked as isModified and written back out afterwards, which may be what's happening to Markus Grunwald (failure to correct the error with "check fix").
* Fix a bug where bbstoreaccounts check could hang or crash.Chris Wilson2013-08-22
| | | | | | | It's not safe to use an iterator after the underlying collection has been modified. We need to restart iterating over the directory in that case. Otherwise we could loop forever looking for an end() that we've already passed, or start accessing unallocated memory.
* Improve variable names and comments.Chris Wilson2013-08-22
| | | | Makes the source code more readable.
* Improve error messages from BackupCommands.Chris Wilson2013-08-22
| | | | | | When a command is sent in the wrong phase, or a command that requires write access is sent to a read-only session, log an error message with the command details (and current phase in the former case).
* Pass std::auto_ptr objects to Protocol for upload.Chris Wilson2013-08-22
| | | | | | | | | | | Passing raw pointers is bad C++ style, and dangerous, because Protocol will free the passed-in pointers after uploading them, so we should not keep using them. Reduce code duplication in BackupClientDirectoryRecord patch/normal upload. Return a std::auto_ptr<BackupStoreFileEncodeStream> instead of a std::auto_ptr<IOStream> from BackupStoreFile::EncodeFile* functions.