Skip to content

Commit cfd2ba6

Browse files
committed
fix mtr compatible issue
1 parent 9a8370c commit cfd2ba6

87 files changed

Lines changed: 195 additions & 769 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

mysql-test/include/eloq_kv_dss.cnf

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +0,0 @@
1-
[mysqld]
2-
eloq_aws_access_key_id=XXXXXXXXXXXXXXX
3-
eloq_aws_secret_key=XXXXXXXXXXXXXXXXXXXXXXXXX
4-
eloq_txlog_rocksdb_cloud_endpoint_url=http://127.0.0.1:9900
5-
eloq_txlog_rocksdb_cloud_bucket_name = eloqsql-mtr-test
6-
eloq_txlog_rocksdb_cloud_bucket_prefix = txlog-
7-
eloq_txlog_rocksdb_cloud_region = ap-northeast-1
8-
eloq_dss_rocksdb_cloud_endpoint_url=http://127.0.0.1:9900
9-
eloq_dss_rocksdb_cloud_bucket_name = eloqsql-mtr-test
10-
eloq_dss_rocksdb_cloud_bucket_prefix = dss-
11-
eloq_dss_rocksdb_cloud_region = ap-northeast-1
12-
eloq_dss_config_file_path =
13-
eloq_dss_peer_node =
14-
eloq_dss_rocksdb_cloud_sst_file_cache_size = 20GB
15-
eloq_dss_rocksdb_cloud_purger_periodicity_secs = 30

mysql-test/include/eloq_kv_keyspace.cnf

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,3 @@
22

33
[mysqld]
44
eloq_random_scan_sort=on
5-
eloq_keyspace_name=mono_test
6-
eloq_dynamodb_endpoint=http://127.0.0.1:9100
7-
eloq_bigtable_project_id=XXXXXXXX
8-
eloq_bigtable_instance_id=XXXXXXXX
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
[mysqld]
2-
eloq_kv_storage=eloqds
1+

scripts/mysql_install_db.sh

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -540,28 +540,11 @@ fi
540540
mysqld_bootstrap="${MYSQLD_BOOTSTRAP-$mysqld}"
541541
mysqld_install_cmd_line()
542542
{
543-
# Create temporary config file for bootstrap
544-
local temp_config=$(mktemp)
545-
546-
cat > "$temp_config" << EOF
547-
[mysqld]
548-
basedir=$basedir
549-
datadir=$ldata
550-
plugin-dir=$plugindir
551-
log-warnings=0
552-
enforce-storage-engine=
553-
max-allowed-packet=8M
554-
net-buffer-length=16K
555-
EOF
556-
557-
# Call mysqld with config file and bootstrap flag
558-
"$mysqld_bootstrap" --eloqsql_config="$temp_config" --bootstrap $args
559-
local exit_code=$?
560-
561-
# Clean up temp file
562-
rm -f "$temp_config"
563-
564-
return $exit_code
543+
"$mysqld_bootstrap" $defaults $defaults_group_suffix "$mysqld_opt" --bootstrap $silent_startup\
544+
"--basedir=$basedir" "--datadir=$ldata" --log-warnings=0 --enforce-storage-engine="" \
545+
"--plugin-dir=${plugindir}" \
546+
$args --max_allowed_packet=8M \
547+
--net_buffer_length=16K
565548
}
566549

567550
# Use $auth_root_socket_user if explicitly specified.

sql/main.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,16 @@ int main(int argc, char **argv)
4343
"Data substrate flags can be passed on command line.\n"
4444
"Use --help to see all available flags.");
4545

46+
#ifdef MYSQLD_LIBRARY_MODE
47+
// When compiled as library mode, only accept flags that are defined in the data substrate
4648
gflags::ParseCommandLineFlags(&argc, &argv, true);
49+
#else
50+
// When compiled as standalone mode, allow unrecognized flags to be passed through to MySQL
51+
gflags::AllowCommandLineReparsing();
52+
// Allow all MySQL-specific flags to pass through without error
53+
gflags::SetCommandLineOption("undefok", "*");
54+
gflags::ParseCommandLineNonHelpFlags(&argc, &argv, false);
55+
#endif
4756

4857
#ifdef WITH_GLOG
4958
InitGoogleLogging(argv);

sql/mysqld.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5263,7 +5263,7 @@ static int init_server_components()
52635263
We need to eat any 'loose' arguments first before we conclude
52645264
that there are unprocessed options.
52655265
*/
5266-
my_getopt_skip_unknown= 0;
5266+
my_getopt_skip_unknown= TRUE;
52675267
#ifdef WITH_WSREP
52685268
if (wsrep_recovery)
52695269
my_getopt_skip_unknown= TRUE;
@@ -5281,12 +5281,12 @@ static int init_server_components()
52815281
if (!wsrep_recovery)
52825282
{
52835283
#endif
5284-
if (remaining_argc > 1)
5285-
{
5286-
fprintf(stderr, "%s: Too many arguments (first extra is '%s').\n",
5287-
my_progname, remaining_argv[1]);
5288-
unireg_abort(1);
5289-
}
5284+
// if (remaining_argc > 1)
5285+
// {
5286+
// fprintf(stderr, "%s: Too many arguments (first extra is '%s').\n",
5287+
// my_progname, remaining_argv[1]);
5288+
// unireg_abort(1);
5289+
// }
52905290
#ifdef WITH_WSREP
52915291
}
52925292
#endif

storage/eloq/eloq_db.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -587,26 +587,22 @@ static int load_view_fetch_func()
587587
std::string schema_image;
588588
bool ok= storage_hd->FetchTable(VIEW_TABLE_NAME, schema_image, exists,
589589
version_ts);
590-
LOG(INFO) << "load_view_fetch_func " << ok << " exists: " << exists << " version_ts: " << version_ts;
591590
if (ok)
592591
{
593592
if (exists)
594593
{
595594
eloq_fetch_view_impl= eloq_fetch_view_normal;
596-
LOG(INFO) << "eloq_fetch_view_impl= eloq_fetch_view_normal";
597595
ret= 0;
598596
}
599597
else
600598
{
601599
eloq_fetch_view_impl= eloq_fetch_view_bootstrap;
602-
LOG(INFO) << "eloq_fetch_view_impl= eloq_fetch_view_bootstrap";
603600
ret= HA_ERR_KEY_NOT_FOUND;
604601
}
605602
}
606603
else
607604
{
608605
eloq_fetch_view_impl= eloq_fetch_view_error;
609-
LOG(INFO) << "eloq_fetch_view_impl= eloq_fetch_view_error";
610606
ret= HA_ERR_INTERNAL_ERROR;
611607
}
612608
return ret;
@@ -616,7 +612,6 @@ static int eloq_fetch_view_bootstrap(THD *thd, LEX_CSTRING db,
616612
LEX_CSTRING view, LEX_CSTRING &frm_binary)
617613
{
618614
DBUG_ENTER_FUNC();
619-
LOG(INFO) << "eloq_fetch_view_bootstrap " << db.str << " " << view.str << ", opt bootstrap: " << opt_bootstrap;
620615
int err= load_view_fetch_func();
621616
if (err == 0)
622617
{
@@ -636,7 +631,6 @@ static int eloq_fetch_view_normal(THD *thd, LEX_CSTRING db, LEX_CSTRING view,
636631
LEX_CSTRING &frm_binary)
637632
{
638633
DBUG_ENTER_FUNC();
639-
LOG(INFO) << "eloq_fetch_view_normal " << db.str << " " << view.str;
640634

641635
int ret= 0;
642636

storage/eloq/eloq_system_handler.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,14 @@ class MariaSystemHandler : public txservice::SystemHandler
4444

4545
private:
4646
MariaSystemHandler();
47-
~MariaSystemHandler()= default;
47+
~MariaSystemHandler()
48+
{
49+
Shutdown();
50+
if (thd_.joinable())
51+
{
52+
thd_.join();
53+
}
54+
}
4855

4956
void SubmitWork(std::packaged_task<bool()> work);
5057

storage/eloq/eloqsql_catalog_factory.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,9 @@ MysqlTableSchema::MysqlTableSchema(const txservice::TableName &table_name,
435435
}
436436

437437
size_t offset= 0;
438-
kv_info_= storage_hd->DeserializeKVCatalogInfo(kv_info, offset);
438+
kv_info_= DataSubstrate::GetGlobal()
439+
->GetStoreHandler()
440+
->DeserializeKVCatalogInfo(kv_info, offset);
439441
record_schema_= EloqRecordSchema(&mysql_table_share_);
440442
}
441443

0 commit comments

Comments
 (0)