Remove SequencerPosition from KeyValueStore

Now KeyValueStore expects kv backend to ensure consistency and there is unusable
for KeyValueStore to store a SequencerPosition.

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
Fix write operation on a deleted object in the same transaction

If the following op happened:
touch obj
delete obj
write obj

KeyValueStore will fail at "write" operation.

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
Add test for objectstore

Add remove then write object in a transaction.

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
tools/cephfs: Clean up waits in Dumper

Remove some LOC by using C_SaferCond.

Signed-off-by: John Spray <john.spray@inktank.com>
tools/cephfs: error handling in journal_export

Was failing on unreadable journal even if
only trying to do an import.

Was calling messenger destructor without init
on early failures due to early instantiation
of Dumper.

Signed-off-by: John Spray <john.spray@inktank.com>
tools/cephfs: Purge trailing objects during import

Reviewed-by: Gregory Farnum <greg@inktank.com>
Signed-off-by: John Spray <john.spray@inktank.com>
qa: set +x on cephfs_journal_tool_smoke

Signed-off-by: John Spray <john.spray@redhat.com>
qa: extend cephfs_journal_tool_smoke

To provide coverage for the 'import' command
resulting in the same contents as before an
export/import cycle.

Signed-off-by: John Spray <john.spray@redhat.com>
erasure-code: pool create must not create profiles

If a non existent profile is provided as an argument to osd pool create,
it must exit on error and not create the profile as a side effect.

http://tracker.ceph.com/issues/8307 refs: #8307

Signed-off-by: Loic Dachary <loic@dachary.org>
erasure-code: OSDMonitor::get_erasure_code is a const

If it is not, the non const version of OSDMap::get_erasure_code_profile
is called and a profile is created as a side effect, which is not
intended.

http://tracker.ceph.com/issues/8307 refs: #8307

Signed-off-by: Loic Dachary <loic@dachary.org>
erasure-code: consistent argument parsing for profiles

Remove the = from the goodchars of the erasure_code_profile argument of
osd pool create so that it is consistent with the goodchars of osd
erasure-code-profile set / rm.

Signed-off-by: Loic Dachary <loic@dachary.org>
osd: improve osd pool create error message readability

Add std::endl to separate independent error messages related to erasure
code.

Signed-off-by: Loic Dachary <loic@dachary.org>
osd: remove non const get_erasure_code_profile

It is not used and will unexpectedly create a new entry if selected when
the const version is intended.

Signed-off-by: Loic Dachary <loic@dachary.org>
osd: add sanity check/warning on a few key configs

Warn when certain config values are set to bad values.

Backport: firefly, dumpling
Signed-off-by: Sage Weil <sage@inktank.com>
erasure-code: create default profile if necessary

http://tracker.ceph.com/issues/8601

Signed-off-by: Loic Dachary <loic@dachary.org>
common: Adds simple tests to verify good behavior

Adds new tests to the lib include/lru.h to verify methods
insert_*.

Signed-off-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@cloudwatt.com>
common: Fixes issue with lru_clear() + add new test

The method lru_clear() must set attribute lru_num to zero
after lru_top, lru_bot and lru_mid are reseted. indeed, lru_num
is the total number of elements found in all of them.

Also the test insures the good behavior of the method
lru_adjust() - lru_touch() calls lru_adjust every time
to balance lru_top and lru_bot by the value of lru_midpoint.

Signed-off-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@cloudwatt.com>
common: Enforces the methods lru_pin() and lru_unpin()

If lru_*pin() is called twice, the counter will be incr/decr
incorrectly since it will count more/less pinned objects than
there is and so corrupts the balancing (lru_adjust()).

Signed-off-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@cloudwatt.com>
Merge pull request #1941 from yuyuyu101/wip-8564

Fix write operation on a deleted object in the same transaction(KeyValueStore)

Reviewed-by: Sage Weil <sage@inktank.com>
PendingReleaseNotes: note about keyvaluestore-dev on-disk format change

Signed-off-by: Sage Weil <sage@inktank.com>