using ThreadLocalPtr to hide ROCKSDB_SUPPORT_THREAD_LOCAL from public…#2380
using ThreadLocalPtr to hide ROCKSDB_SUPPORT_THREAD_LOCAL from public…#2380lightmark wants to merge 5 commits intofacebook:masterfrom
Conversation
|
Thanks @lightmark , this will fix the problem, although it might be a bit disruptive, since it will cause any code that uses perf_context to stop compiling. To help out with the conversion, I'd add in their codebases. An alternative would be to create a build-process-generated rocksdb-defs.h public header file that would be full of necessary |
siying
left a comment
There was a problem hiding this comment.
I didn't see a modification of HISTORY.md. It is very important to mention the breaking interface change there.
include/rocksdb/perf_context.h
Outdated
| #endif | ||
| // Get Thread-local PerfContext object pointer | ||
| // if defined(NPERF_CONTEXT), then the pointer is not thread-local | ||
| PerfContext* GetPerfContext(); |
There was a problem hiding this comment.
I think the naming convention is get_perf_context().
There was a problem hiding this comment.
What do you think about @igorcanadi 's comment?
There was a problem hiding this comment.
i think do it :), applications should be able to write code compatible across rocksdb minor versions
|
@lightmark updated the pull request - view changes |
|
@lightmark updated the pull request - view changes |
|
@lightmark updated the pull request - view changes |
|
@igorcanadi What is the benefit of this MACRO over a version guard? |
|
@lightmark updated the pull request - view changes |
That works too. I actually think that the best solution would be to hack the build process to generate rocksdb-defines.h file. This is standard practice: https://cmake.org/cmake/help/v3.0/module/GenerateExportHeader.html |
|
@igorcanadi Let me read. I am not a cmake expert :( |
|
@lightmark has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Summary: The rocksdb PR facebook/rocksdb#2485 reverted an implementation of rocksdb perf and iostat counters to __thread from rocksdb::ThreadLocal. This change was previously done by PR facebook/rocksdb#2380 update-submodule: rocksdb Reviewed By: alxyang Differential Revision: D5520030 fbshipit-source-id: 2b20883
Upstream commit ID : fb-mysql-5.6.35/2e0ecaf5ce8cb4a1bb1debbe2269839d88de6f1d Summary: The rocksdb PR facebook/rocksdb#2485 reverted an implementation of rocksdb perf and iostat counters to __thread from rocksdb::ThreadLocal. This change was previously done by PR facebook/rocksdb#2380 update-submodule: rocksdb Reviewed By: alxyang Differential Revision: D5520030 fbshipit-source-id: 2b20883
Upstream commit ID : fb-mysql-5.6.35/2e0ecaf5ce8cb4a1bb1debbe2269839d88de6f1d Summary: The rocksdb PR facebook/rocksdb#2485 reverted an implementation of rocksdb perf and iostat counters to __thread from rocksdb::ThreadLocal. This change was previously done by PR facebook/rocksdb#2380 update-submodule: rocksdb Reviewed By: alxyang Differential Revision: D5520030 fbshipit-source-id: 2b20883
Summary: The rocksdb PR facebook/rocksdb#2485 reverted an implementation of rocksdb perf and iostat counters to __thread from rocksdb::ThreadLocal. This change was previously done by PR facebook/rocksdb#2380 @update-submodule: rocksdb Test Plan: sandcastle and make sure sysbench is back Reviewers: alexyang Reviewed By: alexyang Subscribers: webscalesql-eng@fb.com Differential Revision: https://phabricator.intern.facebook.com/D5520030 Signature: t1:5520030:1501275061:d8cca48eb4c82a7ed51e4a11f97947b996970ed5
Upstream commit ID : fb-mysql-5.6.35/2e0ecaf5ce8cb4a1bb1debbe2269839d88de6f1d Summary: The rocksdb PR facebook/rocksdb#2485 reverted an implementation of rocksdb perf and iostat counters to __thread from rocksdb::ThreadLocal. This change was previously done by PR facebook/rocksdb#2380 update-submodule: rocksdb Reviewed By: alxyang Differential Revision: D5520030 fbshipit-source-id: 2b20883
Upstream commit ID : fb-mysql-5.6.35/2e0ecaf5ce8cb4a1bb1debbe2269839d88de6f1d Summary: The rocksdb PR facebook/rocksdb#2485 reverted an implementation of rocksdb perf and iostat counters to __thread from rocksdb::ThreadLocal. This change was previously done by PR facebook/rocksdb#2380 update-submodule: rocksdb Reviewed By: alxyang Differential Revision: D5520030 fbshipit-source-id: 2b20883
Upstream commit ID : fb-mysql-5.6.35/2e0ecaf5ce8cb4a1bb1debbe2269839d88de6f1d Summary: The rocksdb PR facebook/rocksdb#2485 reverted an implementation of rocksdb perf and iostat counters to __thread from rocksdb::ThreadLocal. This change was previously done by PR facebook/rocksdb#2380 update-submodule: rocksdb Reviewed By: alxyang Differential Revision: D5520030 fbshipit-source-id: 2b20883
Summary: The rocksdb PR facebook/rocksdb#2485 reverted an implementation of rocksdb perf and iostat counters to __thread from rocksdb::ThreadLocal. This change was previously done by PR facebook/rocksdb#2380 update-submodule: rocksdb Reviewed By: alxyang Differential Revision: D5520030 fbshipit-source-id: 2d04833
Summary: The rocksdb PR facebook/rocksdb#2485 reverted an implementation of rocksdb perf and iostat counters to __thread from rocksdb::ThreadLocal. This change was previously done by PR facebook/rocksdb#2380 update-submodule: rocksdb Reviewed By: alxyang Differential Revision: D5520030 fbshipit-source-id: 2d04833
Summary: The rocksdb PR facebook/rocksdb#2485 reverted an implementation of rocksdb perf and iostat counters to __thread from rocksdb::ThreadLocal. This change was previously done by PR facebook/rocksdb#2380 update-submodule: rocksdb Reviewed By: alxyang Differential Revision: D5520030 fbshipit-source-id: 2d04833
Summary: The rocksdb PR facebook/rocksdb#2485 reverted an implementation of rocksdb perf and iostat counters to __thread from rocksdb::ThreadLocal. This change was previously done by PR facebook/rocksdb#2380 update-submodule: rocksdb Reviewed By: alxyang Differential Revision: D5520030 fbshipit-source-id: 2d04833
Summary: The rocksdb PR facebook/rocksdb#2485 reverted an implementation of rocksdb perf and iostat counters to __thread from rocksdb::ThreadLocal. This change was previously done by PR facebook/rocksdb#2380 update-submodule: rocksdb Reviewed By: alxyang Differential Revision: D5520030 fbshipit-source-id: 2d04833
Summary: The rocksdb PR facebook/rocksdb#2485 reverted an implementation of rocksdb perf and iostat counters to __thread from rocksdb::ThreadLocal. This change was previously done by PR facebook/rocksdb#2380 update-submodule: rocksdb Reviewed By: alxyang Differential Revision: D5520030 fbshipit-source-id: 2d04833
Summary: The rocksdb PR facebook/rocksdb#2485 reverted an implementation of rocksdb perf and iostat counters to __thread from rocksdb::ThreadLocal. This change was previously done by PR facebook/rocksdb#2380 update-submodule: rocksdb Differential Revision: D5520030 (a27984c) fbshipit-source-id: 0da3e86fb08
Summary: The rocksdb PR facebook/rocksdb#2485 reverted an implementation of rocksdb perf and iostat counters to __thread from rocksdb::ThreadLocal. This change was previously done by PR facebook/rocksdb#2380 update-submodule: rocksdb Differential Revision: D5520030 (facebook@a27984c) fbshipit-source-id: 0da3e86fb08
Summary: The rocksdb PR facebook/rocksdb#2485 reverted an implementation of rocksdb perf and iostat counters to __thread from rocksdb::ThreadLocal. This change was previously done by PR facebook/rocksdb#2380 update-submodule: rocksdb Differential Revision: D5520030 (facebook@a27984c) fbshipit-source-id: 0da3e86fb08
Summary: The rocksdb PR facebook/rocksdb#2485 reverted an implementation of rocksdb perf and iostat counters to __thread from rocksdb::ThreadLocal. This change was previously done by PR facebook/rocksdb#2380 update-submodule: rocksdb Differential Revision: D5520030 (facebook@a27984c) fbshipit-source-id: 0da3e86fb08
Summary: The rocksdb PR facebook/rocksdb#2485 reverted an implementation of rocksdb perf and iostat counters to __thread from rocksdb::ThreadLocal. This change was previously done by PR facebook/rocksdb#2380 update-submodule: rocksdb Differential Revision: D5520030 (facebook@a27984c) fbshipit-source-id: 0da3e86fb08
Summary: The rocksdb PR facebook/rocksdb#2485 reverted an implementation of rocksdb perf and iostat counters to __thread from rocksdb::ThreadLocal. This change was previously done by PR facebook/rocksdb#2380 update-submodule: rocksdb Differential Revision: D5520030 (facebook@a27984c) fbshipit-source-id: 0da3e86fb08
Summary: The rocksdb PR facebook/rocksdb#2485 reverted an implementation of rocksdb perf and iostat counters to __thread from rocksdb::ThreadLocal. This change was previously done by PR facebook/rocksdb#2380 update-submodule: rocksdb Differential Revision: D5520030 (facebook@a27984c) fbshipit-source-id: 0da3e86fb08
Summary: The rocksdb PR facebook/rocksdb#2485 reverted an implementation of rocksdb perf and iostat counters to __thread from rocksdb::ThreadLocal. This change was previously done by PR facebook/rocksdb#2380 update-submodule: rocksdb Differential Revision: D5520030 (facebook@a27984c) fbshipit-source-id: 0da3e86fb08
Summary: The rocksdb PR facebook/rocksdb#2485 reverted an implementation of rocksdb perf and iostat counters to __thread from rocksdb::ThreadLocal. This change was previously done by PR facebook/rocksdb#2380 @update-submodule: rocksdb Differential Revision: D5520030
Summary: The rocksdb PR facebook/rocksdb#2485 reverted an implementation of rocksdb perf and iostat counters to __thread from rocksdb::ThreadLocal. This change was previously done by PR facebook/rocksdb#2380 @update-submodule: rocksdb Differential Revision: D5520030
Summary: The rocksdb PR facebook/rocksdb#2485 reverted an implementation of rocksdb perf and iostat counters to __thread from rocksdb::ThreadLocal. This change was previously done by PR facebook/rocksdb#2380 @update-submodule: rocksdb Differential Revision: D5520030
Summary: The rocksdb PR facebook/rocksdb#2485 reverted an implementation of rocksdb perf and iostat counters to __thread from rocksdb::ThreadLocal. This change was previously done by PR facebook/rocksdb#2380 @update-submodule: rocksdb Differential Revision: D5520030
Summary: The rocksdb PR facebook/rocksdb#2485 reverted an implementation of rocksdb perf and iostat counters to __thread from rocksdb::ThreadLocal. This change was previously done by PR facebook/rocksdb#2380 @update-submodule: rocksdb Differential Revision: D5520030
Summary: The rocksdb PR facebook/rocksdb#2485 reverted an implementation of rocksdb perf and iostat counters to __thread from rocksdb::ThreadLocal. This change was previously done by PR facebook/rocksdb#2380 @update-submodule: rocksdb Differential Revision: D5520030
Summary: The rocksdb PR facebook/rocksdb#2485 reverted an implementation of rocksdb perf and iostat counters to __thread from rocksdb::ThreadLocal. This change was previously done by PR facebook/rocksdb#2380 @update-submodule: rocksdb Differential Revision: D5520030
Summary: The rocksdb PR facebook/rocksdb#2485 reverted an implementation of rocksdb perf and iostat counters to __thread from rocksdb::ThreadLocal. This change was previously done by PR facebook/rocksdb#2380 @update-submodule: rocksdb Differential Revision: D5520030
Summary: The rocksdb PR facebook/rocksdb#2485 reverted an implementation of rocksdb perf and iostat counters to __thread from rocksdb::ThreadLocal. This change was previously done by PR facebook/rocksdb#2380 @update-submodule: rocksdb Differential Revision: D5520030
Summary: The rocksdb PR facebook/rocksdb#2485 reverted an implementation of rocksdb perf and iostat counters to __thread from rocksdb::ThreadLocal. This change was previously done by PR facebook/rocksdb#2380 @update-submodule: rocksdb Differential Revision: D5520030
… headers
#2199 should not reference RocksDB-specific macros (like ROCKSDB_SUPPORT_THREAD_LOCAL in this case) to public headers,
iostats_context.handperf_context.h. We shouldn't do that because users have to provide these compiler flags when building their binary with RocksDB.We should hide the thread local global variable inside our implementation and just expose a function api to retrieve these variables. It may break some users for now but good for long term.
make check -j64