Not the answer you need?
Register and ask your own question!

Question about Myrocks

fuzhiyufuzhiyu EntrantInactive User Role Beginner
File:ha_rocksdb.cc
Function:rocksdb_init_func
Code:
Rdb_hton_init_state::Scoped_lock state_lock(*rdb_get_hton_init_state(), true);
SHIP_ASSERT(!rdb_get_hton_init_state()->initialized());
Question:
Why add the above code? for what? Because the facebook myrocks source code does not have the above code.

Comments

  • George LorchGeorge Lorch Percona Percona Moderator Role Patron
    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.
  • fuzhiyufuzhiyu Entrant Inactive User Role Beginner
    Thank you for your answer!!

    in the Facebook MyRocks CMakeLists.txt, See the following:
    MYSQL_ADD_PLUGIN(rocksdb_se ${ROCKSDB_SOURCES} STORAGE_ENGINE DEFAULT STATIC_ONLY LINK_LIBRARIES ${rocksdb_static_libs}

    in the Percona MyRocks CMakeLists.txt, See the following:
    MYSQL_ADD_PLUGIN(rocksdb ${ROCKSDB_SOURCES} STORAGE_ENGINE DEFAULT MODULE_ONLY LINK_LIBRARIES ${rocksdb_static_libs}

    Facebook MyRocks is 'compiled in' to Facebook MySQL means that when compiling Facebook MyRocks to use STATIC_ONLY, Is that right?
  • George LorchGeorge Lorch Percona Percona Moderator Role Patron
    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.
  • fuzhiyufuzhiyu Entrant Inactive User Role Beginner
    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?
  • George LorchGeorge Lorch Percona Percona Moderator Role Patron
    https://jira.percona.com/browse/PS-3992 is the reason and explanation of why it exists, introduced in this commit https://github.com/percona/percona-server/commit/c9383d615bd50787973518cc8929db4d4fc57086. 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.
  • fuzhiyufuzhiyu Entrant Inactive User Role Beginner
    I don't know how to express my gratitude to you. Thank you very much.

    Hope to communicate with more!
  • George LorchGeorge Lorch Percona Percona Moderator Role Patron
    Glad to be of service.
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.