PG log did not previously store the object locator. To get the hash for
the hobject, scan the collection for the object during read_log if we
encouter an old style log entry.
Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
Previously, fsconverter was required to update an osd filestore to the
most recent version. cosd will now handle that automatically on
startup. cosd --convert-filestore will also update the FileStore
to the most recent version.
Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
We need to move past the item we already had or else we'll remove it again
during the next iteration of the loop.
Signed-off-by: Sage Weil <sage@newdream.net>
Just use unlink() and then link(). Carry an inode ref to avoid badness.
The relink() is left over from a simpler time when we didn't do proper
refcounting.
Signed-off-by: Sage Weil <sage@newdream.net>
Previously, committed_seq was set to op_seq at the end of
replay_journal. committed_seq should not actually be set until the
sync thread runs.
Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
When merging readdir results into the cache, we want to remove any names
_preceeding_ the current item before updating it. Then, at the end, we
clean up the trailing items.
This fixes a cfuse crash on workunits/snaps/snaptest-2.sh.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Add sanity checks in close_dir(), and make sure we aren't replacing a dn
with the same name in link().
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
When merging readdir results into the cache, we want to remove any names
_preceeding_ the current item before updating it. Then, at the end, we
clean up the trailing items.
This fixes a cfuse crash on workunits/snaps/snaptest-2.sh.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Previously, we stored the collection_list handle as an opaque
uint64_t. Now, collection_list_handle_t is a struct defined
in types.h.
Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
CollectionIndex implementations may perform compound operations
leaving invalid state if interrupted. index->cleanup() gives
the implementation an oportunity to cleanup any in-progress
operation. For HashIndex, split and merge fall in this
category
Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
update_version_stamp may be used to refresh the filestore version
stamp when all collections have been brought to the current
version.
Signed-off-by: Samuel Just <rexludorum@gmail.com>
A filestore will now be tagged with a version stamp during
mkfs. If on mount the version stamp detected lags the current
version, the mount will fail unless filestore_update_collections
is set in gconf. If it is set, opening a collection will cause
the version stamp on the collection to be read and the
appropriate indexing implmentation to be used. This will allow
for conversion from old collection indexing schemes to new
ones.
Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
Adds ColletionIndex, an interface for collection indexing
systems, and HashIndex, a mechanism for organising a prehashed
collection.
Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
sobject_t requires only an object_t and a snapid_t. hobject_t also
requires the hash which should be used for the object. In most cases,
the osd must fill this in using the op message. In cases where the hash
used does not matter (as in the metadata collection), the explicit
hobject_t(const sobject_t &) constructor supplies a hash.
Signed-off-by: Samuel Just <samuel.just@dreamhost.com>