Skip to content

Commit

Permalink
Add ddst_dict_init api support for rocksdb ddse (percona#1297)
Browse files Browse the repository at this point in the history
Summary:
Add ddst_dict_init handler api support for rocksdb dd

Currently rocksdb ddst_dict_init() doesn't add any rocksdb specific tables and tablespace during ddse initialize.

Pull Request resolved: facebook/mysql-5.6#1297

Test Plan: CI

Differential Revision: D46700996

fbshipit-source-id: fbb80035b54cc068c845e63fe6903c8488fce1d3
  • Loading branch information
sunshine-Chun authored and inikep committed Dec 18, 2023
1 parent f65a4bc commit 564b995
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions storage/rocksdb/ha_rocksdb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6345,6 +6345,7 @@ static int rocksdb_init_internal(void *const p) {
rocksdb_hton->dict_get_server_version = rocksdb_dict_get_server_version;
rocksdb_hton->dict_set_server_version = rocksdb_dict_set_server_version;
rocksdb_hton->is_supported_system_table = rocksdb_is_supported_system_table;
rocksdb_hton->ddse_dict_init = rocksdb_ddse_dict_init;

rocksdb_hton->flags = HTON_SUPPORTS_EXTENDED_KEYS | HTON_CAN_RECREATE |
HTON_SUPPORTS_ONLINE_BACKUPS;
Expand Down
15 changes: 15 additions & 0 deletions storage/rocksdb/rdb_native_dd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

/* MyRocks header files */
#include "ha_rocksdb.h"
#include "sql/plugin_table.h"
#include "storage/rocksdb/ha_rocksdb_proto.h"
#include "storage/rocksdb/rdb_datadic.h"

Expand Down Expand Up @@ -77,4 +78,18 @@ bool rocksdb_is_supported_system_table([[maybe_unused]] const char *db_name,
return false;
}

bool rocksdb_ddse_dict_init(
[[maybe_unused]] dict_init_mode_t dict_init_mode, uint,
[[maybe_unused]] List<const dd::Object_table> *tables,
[[maybe_unused]] List<const Plugin_tablespace> *tablespaces) {
assert(tables);
assert(tables->is_empty());
assert(tablespaces);
assert(tablespaces->is_empty());

assert(dict_init_mode == DICT_INIT_CREATE_FILES ||
dict_init_mode == DICT_INIT_CHECK_FILES);

return false;
}
} // namespace myrocks
4 changes: 4 additions & 0 deletions storage/rocksdb/rdb_native_dd.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

/* MySQL header files */
#include "sql/dd/object_id.h"
#include "sql/handler.h"

namespace dd {
class Table;
Expand All @@ -32,6 +33,9 @@ void rocksdb_dict_register_dd_table_id(dd::Object_id dd_table_id);
bool rocksdb_dict_get_server_version(uint *version);
bool rocksdb_dict_set_server_version();
bool rocksdb_is_supported_system_table(const char *, const char *, bool);
bool rocksdb_ddse_dict_init(dict_init_mode_t dict_init_mode, uint version,
List<const dd::Object_table> *tables,
List<const Plugin_tablespace> *tablespaces);

class native_dd {
private:
Expand Down

0 comments on commit 564b995

Please sign in to comment.