Question about Myrocks
Rdb_hton_init_state::Scoped_lock state_lock(*rdb_get_hton_init_state(), true);
Why add the above code? for what? Because the facebook myrocks source code does not have the above code.

There are many differences between Percona MyRocks and Facebook MyRocks and this is just one small one. Facebook MyRocks is ‘compiled in’ to Facebook MySQL and can not be unloaded as a plugin. Percona MyRocks can be unloaded and reloaded, although it is not suggested to do so. This is the result of a partial fix to try to prevent crashing on load/unload/load cycles, but there are still many problems in executing that sequence.

Thank you for your answer!!

in the Facebook MyRocks CMakeLists.txt, See the following:

in the Percona MyRocks CMakeLists.txt, See the following:

Facebook MyRocks is ‘compiled in’ to Facebook MySQL means that when compiling Facebook MyRocks to use STATIC_ONLY, Is that right?

Correct. Facebook MySQL 5.6.35 with MyRocks is intended to be used with MyRocks as the only transactional engine (no InnoDB present). Percona Server 5.7 and 8.0, MyRocks is an installable plugin that is not installed by default, only upon request.

Thank you very much for answering my questions. Thank you very much!

however I want to know :

  1. what the function of Rdb_hton_init_state::Scoped_lock in rocksdb_init_func or rocksdb_done_func?
  2. read the annotation of struct Rdb_hton_init_state :plus a reader-writer lock to protect it without serializing reads Does parallel reading occur? is the reason and explanation of why it exists, introduced in this commit It exists solely to serialize access to the knowledge of whether the MyRocks plugin is installed and initialized or not, primarily for the benefit of the MyRocks information_schema plugins.

I don’t know how to express my gratitude to you. Thank you very much.

Hope to communicate with more!

Glad to be of service.