Skip to content

revert perf_context and io_stats to __thread#2485

Closed
lightmark wants to merge 2 commits intofacebook:masterfrom
lightmark:revert_thread_local
Closed

revert perf_context and io_stats to __thread#2485
lightmark wants to merge 2 commits intofacebook:masterfrom
lightmark:revert_thread_local

Conversation

@lightmark
Copy link
Copy Markdown
Contributor

#2380 introduces a regression by replacing __thread with ThreadLocalPtr. Revert the thread local implementation back.

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@lightmark has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

iostats_context.Reset(static_cast<void*>(new IOStatsContext()));
}
return static_cast<IOStatsContext*>(iostats_context.Get());
return &iostats_context;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't get it. Will it even compile if ROCKSDB_SUPPORT_THREAD_LOCAL is not set?

Copy link
Copy Markdown
Contributor Author

@lightmark lightmark Jun 23, 2017

Choose a reason for hiding this comment

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

my bad. I will return nullptr if not set.

@ajkr
Copy link
Copy Markdown
Contributor

ajkr commented Jun 23, 2017

please look into avoiding the call to PERF_COUNTER_ADD when GetPerfLevel() < kEnableCount before going forward with the rollback. It may solve the problem in a better way.

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@lightmark updated the pull request - view changes - changes since last import

@siying
Copy link
Copy Markdown
Contributor

siying commented Jun 23, 2017

@ajkr yes we should do that too. The cost when perf context is enabled is also important as it's common to have count stats always enabled. For example, MyRocks does that.


// perf_context and iostats_context take 2 ids
ASSERT_EQ(IDChecker::PeekId(), 2u);
ASSERT_EQ(IDChecker::PeekId(), 0u);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't get why these numbers need to be changed, but I trust you are doing the right thing.

Copy link
Copy Markdown
Contributor Author

@lightmark lightmark Jun 26, 2017

Choose a reason for hiding this comment

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

Because previously I changed it to use ThreadLocalPtr and there is a global counter summarizes the total number of entries in the ptr. If I add iostats and perf_stats there will two more entries from the start of the db. So for this part, it is just a reversion. Nothing special.

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@lightmark has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

yiwu-arbug pushed a commit that referenced this pull request Jun 26, 2017
Summary:
#2380 introduces a regression by replacing __thread with ThreadLocalPtr. Revert the thread local implementation back.
Closes #2485

Differential Revision: D5308050

Pulled By: lightmark

fbshipit-source-id: 2676e9c22edf76e8133d3f4c50e2711e11a95480
facebook-github-bot pushed a commit to facebook/mysql-5.6 that referenced this pull request Jul 29, 2017
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
george-lorch pushed a commit to george-lorch/percona-server that referenced this pull request Sep 4, 2017
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
george-lorch pushed a commit to george-lorch/percona-server that referenced this pull request Sep 4, 2017
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
samcmuldroch pushed a commit to samcmuldroch/mysql-5.6 that referenced this pull request Sep 6, 2017
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
george-lorch pushed a commit to george-lorch/percona-server that referenced this pull request Sep 7, 2017
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
george-lorch pushed a commit to george-lorch/percona-server that referenced this pull request Sep 7, 2017
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
george-lorch pushed a commit to george-lorch/percona-server that referenced this pull request Sep 7, 2017
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
facebook-github-bot pushed a commit to facebook/mysql-5.6 that referenced this pull request Dec 23, 2019
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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Aug 12, 2020
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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Sep 9, 2020
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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Sep 16, 2020
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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Oct 5, 2020
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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Nov 11, 2020
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
facebook-github-bot pushed a commit to facebook/mysql-5.6 that referenced this pull request Mar 8, 2021
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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Aug 16, 2021
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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Aug 17, 2021
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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Aug 30, 2021
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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Aug 30, 2021
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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Aug 31, 2021
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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Sep 1, 2021
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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Sep 2, 2021
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
hermanlee pushed a commit to facebook/mysql-5.6 that referenced this pull request Jan 10, 2022
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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Jan 17, 2022
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
ldonoso pushed a commit to ldonoso/percona-server that referenced this pull request Mar 15, 2022
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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request May 20, 2022
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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request May 23, 2022
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
laurynas-biveinis pushed a commit to laurynas-biveinis/mysql-5.6 that referenced this pull request Aug 11, 2022
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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Mar 28, 2023
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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Jun 1, 2023
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
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Jun 14, 2023
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
inikep pushed a commit to inikep/percona-server that referenced this pull request Apr 9, 2024
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
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.

4 participants