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>
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>
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>
Merge pull request #1966 from dachary/wip-erasure-code-profile-default

DNM: erasure-code: create default profile if necessary

Reviewed-by: Sage Weil <sage@inktank.com>
Merge pull request #1964 from ceph/wip-osd-configs

osd: add sanity check/warning on a few key configs

Reviewed-by: Loic Dachary <loic@dachary.org>
Merge pull request #1954 from dachary/wip-8307-erasure-code-profile-implicit-creation

erasure code profile implicit creation

Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
Merge pull request #1951 from sahid/ut-lru

Adds tests to include/lru.h + fixes small issues

Reviewed-by: Loic Dachary <loic@dachary.org>
Reviewed-by: Sage Weil <sage@inktank.com>
osd: verify osd config sanity checks

Signed-off-by: Loic Dachary <loic@dachary.org>
mon/OSDMonitor: fix build error

This broke with 360de6adf24ef9a1287d169416d5e9bbb72afbec.

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