Skip to content

kv/RocksDBStore: always release column family handles#35811

Merged
tchaikov merged 6 commits intoceph:masterfrom
tchaikov:wip-46054
Jul 1, 2020
Merged

kv/RocksDBStore: always release column family handles#35811
tchaikov merged 6 commits intoceph:masterfrom
tchaikov:wip-46054

Conversation

@tchaikov
Copy link
Contributor

Checklist

  • References tracker ticket
  • Updates documentation if necessary
  • Includes tests for new functionality or reproducer for bug

Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard backend
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox

tchaikov added 6 commits June 27, 2020 22:48
Signed-off-by: Kefu Chai <kchai@redhat.com>
for better readability

Signed-off-by: Kefu Chai <kchai@redhat.com>
for better readablity

Signed-off-by: Kefu Chai <kchai@redhat.com>
instead of using two vectors, use a map for tracking names and handles
of column families.

Signed-off-by: Kefu Chai <kchai@redhat.com>
to avoid leak in ColumnFamilySet

Fixes: https://tracker.ceph.com/issues/46054
Signed-off-by: Kefu Chai <kchai@redhat.com>
to make sure that the handles are released before db is deleted

Fixes: https://tracker.ceph.com/issues/46054
Signed-off-by: Kefu Chai <kchai@redhat.com>
@tchaikov
Copy link
Contributor Author

if (!status.ok()) {
if (auto status = rocksdb::WriteStringToFile(env, new_sharding,
sharding_def_file, true);
!status.ok()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since status is local, maybe just !rocksdb::Write...(...).ok() ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aclamk thanks for your review Adam! i will implement your suggestion in a follow up PR. as some rados suites are failing due to this issue, i am going to merge it as it is.

using cf_deleter_t = std::function<void(rocksdb::ColumnFamilyHandle*)>;
using columns_t = std::map<std::string,
std::unique_ptr<rocksdb::ColumnFamilyHandle,
cf_deleter_t>>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love that you merged names & handles together.

return r;
if (bat.Count() > 0) {
flush_batch(&bat);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch, previously even empty batch was submitted.

Copy link
Contributor

@aclamk aclamk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good.

@tchaikov
Copy link
Contributor Author

tchaikov commented Jul 1, 2020

jenkins test dashboard backend

@tchaikov tchaikov merged commit 87395bc into ceph:master Jul 1, 2020
@tchaikov tchaikov deleted the wip-46054 branch July 1, 2020 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants