summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/ceph-rocksdb-compat.patch
blob: 1a3c6b0b2370fe07c826200b778491118a9deae0 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
Fix compatibility with newer versions of RocksDB.

Adapted from this upstream patch, with some additional changes for 12.2:
https://github.com/ceph/ceph/commit/9d73a7121fdb1ae87cb1aa6f7d9d7a13f329ae68

diff --git a/src/kv/RocksDBStore.cc b/src/kv/RocksDBStore.cc
index 8660afe1886d..bc0de79e23cb 100644
--- a/src/kv/RocksDBStore.cc
+++ b/src/kv/RocksDBStore.cc
@@ -505,7 +505,7 @@
   // considering performance overhead, default is disabled
   if (g_conf->rocksdb_perf) {
     rocksdb::SetPerfLevel(rocksdb::PerfLevel::kEnableTimeExceptForMutex);
-    rocksdb::perf_context.Reset();
+    rocksdb::get_perf_context()->Reset();
   }
 
   RocksDBTransactionImpl * _t =
@@ -532,13 +532,13 @@
     utime_t write_wal_time;
     utime_t write_pre_and_post_process_time;
     write_wal_time.set_from_double(
-	static_cast<double>(rocksdb::perf_context.write_wal_time)/1000000000);
+	static_cast<double>(rocksdb::get_perf_context()->write_wal_time)/1000000000);
     write_memtable_time.set_from_double(
-	static_cast<double>(rocksdb::perf_context.write_memtable_time)/1000000000);
+	static_cast<double>(rocksdb::get_perf_context()->write_memtable_time)/1000000000);
     write_delay_time.set_from_double(
-	static_cast<double>(rocksdb::perf_context.write_delay_time)/1000000000);
+	static_cast<double>(rocksdb::get_perf_context()->write_delay_time)/1000000000);
     write_pre_and_post_process_time.set_from_double(
-	static_cast<double>(rocksdb::perf_context.write_pre_and_post_process_time)/1000000000);
+	static_cast<double>(rocksdb::get_perf_context()->write_pre_and_post_process_time)/1000000000);
     logger->tinc(l_rocksdb_write_memtable_time, write_memtable_time);
     logger->tinc(l_rocksdb_write_delay_time, write_delay_time);
     logger->tinc(l_rocksdb_write_wal_time, write_wal_time);
@@ -558,7 +558,7 @@
   // considering performance overhead, default is disabled
   if (g_conf->rocksdb_perf) {
     rocksdb::SetPerfLevel(rocksdb::PerfLevel::kEnableTimeExceptForMutex);
-    rocksdb::perf_context.Reset();
+    rocksdb::get_perf_context()->Reset();
   }
 
   RocksDBTransactionImpl * _t =
@@ -586,13 +586,13 @@
     utime_t write_wal_time;
     utime_t write_pre_and_post_process_time;
     write_wal_time.set_from_double(
-	static_cast<double>(rocksdb::perf_context.write_wal_time)/1000000000);
+	static_cast<double>(rocksdb::get_perf_context()->write_wal_time)/1000000000);
     write_memtable_time.set_from_double(
-	static_cast<double>(rocksdb::perf_context.write_memtable_time)/1000000000);
+	static_cast<double>(rocksdb::get_perf_context()->write_memtable_time)/1000000000);
     write_delay_time.set_from_double(
-	static_cast<double>(rocksdb::perf_context.write_delay_time)/1000000000);
+	static_cast<double>(rocksdb::get_perf_context()->write_delay_time)/1000000000);
     write_pre_and_post_process_time.set_from_double(
-	static_cast<double>(rocksdb::perf_context.write_pre_and_post_process_time)/1000000000);
+	static_cast<double>(rocksdb::get_perf_context()->write_pre_and_post_process_time)/1000000000);
     logger->tinc(l_rocksdb_write_memtable_time, write_memtable_time);
     logger->tinc(l_rocksdb_write_delay_time, write_delay_time);
     logger->tinc(l_rocksdb_write_wal_time, write_wal_time);