1
1
# !/usr/bin/perl
2
2
# -*- cperl -*-
3
3
4
- # Copyright (c) 2004, 2019 , Oracle and/or its affiliates. All rights reserved.
4
+ # Copyright (c) 2004, 2020 , Oracle and/or its affiliates. All rights reserved.
5
5
#
6
6
# This program is free software; you can redistribute it and/or modify
7
7
# it under the terms of the GNU General Public License, version 2.0,
@@ -2985,7 +2985,7 @@ ($)
2985
2985
mtr_report(" - enabling ndbcluster" );
2986
2986
$ndbcluster_enabled = 1;
2987
2987
# Add MySQL Cluster test suites
2988
- $DEFAULT_SUITES .=" ,ndb,ndb_binlog,rpl_ndb,ndb_rpl,ndb_memcache " ;
2988
+ $DEFAULT_SUITES .=" ,ndb,ndb_binlog,rpl_ndb,ndb_rpl" ;
2989
2989
return ;
2990
2990
}
2991
2991
@@ -3234,163 +3234,6 @@ sub ndbd_start {
3234
3234
return ;
3235
3235
}
3236
3236
3237
- # Start memcached with the special ndb_engine.so plugin
3238
- # making it use NDB as backend.
3239
- sub memcached_start {
3240
- my ($cluster , $memcached ) = @_ ;
3241
-
3242
- my $name = $memcached -> name();
3243
- mtr_verbose(" memcached_start '$name '" );
3244
-
3245
- # Clear env used by include/have_memcached.inc
3246
- $ENV {' NDB_MEMCACHED_STARTED' } = 0;
3247
-
3248
- # Look for the ndb_engine.so memcache plugin
3249
- my $found_so = my_find_file($bindir ,
3250
- [" storage/ndb/memcache" , # source or build
3251
- " lib" , " lib64" ], # install
3252
- " ndb_engine.so" , NOT_REQUIRED);
3253
- if ($found_so eq " " )
3254
- {
3255
- # The ndb_engine memcache plugin is not a mandatory
3256
- # component, silently skip to start memcached if it's not
3257
- # found
3258
- mtr_verbose(" Could not find the ndb_engine memcache plugin" );
3259
- return ;
3260
- }
3261
- mtr_verbose(" Found memcache plugin: '$found_so '" );
3262
-
3263
- # Look for the generated perl script which tells
3264
- # location of memcached etc.
3265
- my $found_perl_source = my_find_file($bindir ,
3266
- [" storage/ndb/memcache" , # source
3267
- " mysql-test/lib" , # install
3268
- " share/mysql-test/lib" ], # install
3269
- " memcached_path.pl" );
3270
- mtr_verbose(" Found memcache script: '$found_perl_source '" );
3271
-
3272
- # Source the found perl script which tells
3273
- # location of memcached etc.
3274
- require " $found_perl_source " ;
3275
-
3276
- if (! memcached_is_available())
3277
- {
3278
- mtr_error(" Memcached not available." );
3279
- }
3280
- my $exe = " " ;
3281
- if (memcached_is_bundled())
3282
- {
3283
- # The bundled memcached has been built
3284
- # and made part of the package, find where
3285
- # it ended up and use it.
3286
- $exe = my_find_bin($bindir ,
3287
- [" libexec" ,
3288
- " sbin" ,
3289
- " bin" ,
3290
- " storage/ndb/memcache/extra/memcached" ],
3291
- " memcached" );
3292
- mtr_verbose(" Found bundled memcached '$exe '" );
3293
- }
3294
- else
3295
- {
3296
- # External memcached has been used to build ndb_engine.so
3297
- # The path to that memcached has been hardcoded in
3298
- # memcached_path.pl, use that path.
3299
- # This requires same machine as build or memcached
3300
- # also installed in same location as when it was built.
3301
- $exe = get_memcached_exe_path();
3302
- if ($exe eq " " or ! -x $exe )
3303
- {
3304
- mtr_error(" Failed to find memcached binary '$exe '" );
3305
- }
3306
- mtr_verbose(" Using memcached binary '$exe '" );
3307
- }
3308
-
3309
-
3310
- my $args ;
3311
- mtr_init_args(\$args );
3312
- # TCP port number to listen on
3313
- mtr_add_arg($args , " -p %d " , $memcached -> value(' port' ));
3314
- # Max simultaneous connections
3315
- mtr_add_arg($args , " -c %d " , $memcached -> value(' max_connections' ));
3316
- # Load engine as storage engine, ie. /path/ndb_engine.so
3317
- mtr_add_arg($args , " -E" );
3318
- mtr_add_arg($args , $found_so );
3319
- # Config options for loaded storage engine
3320
- {
3321
- my @opts ;
3322
- push (@opts , " connectstring=" . $memcached -> value(' ndb_connectstring' ));
3323
- push (@opts , $memcached -> if_exist(" options" ));
3324
- mtr_add_arg($args , " -e" );
3325
- mtr_add_arg($args , join (" ;" , @opts ));
3326
- }
3327
-
3328
- if ($opt_gdb )
3329
- {
3330
- gdb_arguments(\$args , \$exe , " memcached" );
3331
- }
3332
-
3333
- my $proc = My::SafeProcess-> new
3334
- ( name => $name ,
3335
- path => $exe ,
3336
- args => \$args ,
3337
- output => " $opt_vardir /log/$name .out" ,
3338
- error => " $opt_vardir /log/$name .out" ,
3339
- append => 1,
3340
- verbose => $opt_verbose ,
3341
- );
3342
- mtr_verbose(" Started $proc " );
3343
-
3344
- $memcached -> {proc } = $proc ;
3345
-
3346
- # Set env used by include/have_memcached.inc
3347
- $ENV {' NDB_MEMCACHED_STARTED' } = 1;
3348
-
3349
- return ;
3350
- }
3351
-
3352
-
3353
- sub memcached_load_metadata ($) {
3354
- my $cluster = shift ;
3355
-
3356
- foreach my $mysqld (mysqlds())
3357
- {
3358
- if (-d $mysqld -> value(' datadir' ) . " /" . " ndbmemcache" )
3359
- {
3360
- mtr_verbose(" skipping memcache metadata (already stored)" );
3361
- return ;
3362
- }
3363
- }
3364
-
3365
- my $sql_script = my_find_file($bindir ,
3366
- [" share/mysql/memcache-api" , # RPM install
3367
- " share/memcache-api" , # Other installs
3368
- " scripts" # Build tree
3369
- ],
3370
- " ndb_memcache_metadata.sql" , NOT_REQUIRED);
3371
- mtr_verbose(" memcached_load_metadata: '$sql_script '" );
3372
- if (-f $sql_script )
3373
- {
3374
- my $args ;
3375
- mtr_init_args(\$args );
3376
- mtr_add_arg($args , " --defaults-file=%s " , $path_config_file );
3377
- mtr_add_arg($args , " --defaults-group-suffix=%s " , $cluster -> suffix());
3378
- mtr_add_arg($args , " --connect-timeout=20" );
3379
- if ( My::SafeProcess-> run(
3380
- name => " ndbmemcache config loader" ,
3381
- path => $exe_mysql ,
3382
- args => \$args ,
3383
- input => $sql_script ,
3384
- output => " $opt_vardir /log/memcache_config.log" ,
3385
- error => " $opt_vardir /log/memcache_config.log"
3386
- ) != 0)
3387
- {
3388
- mtr_error(" Could not load ndb_memcache_metadata.sql file" );
3389
- }
3390
- }
3391
- }
3392
-
3393
-
3394
3237
sub ndbcluster_start ($) {
3395
3238
my $cluster = shift ;
3396
3239
@@ -5833,7 +5676,7 @@ ($)
5833
5676
}
5834
5677
5835
5678
# Check if any remaining servers need restart
5836
- foreach my $server (ndb_mgmds(), ndbds(), memcacheds() )
5679
+ foreach my $server (ndb_mgmds(), ndbds())
5837
5680
{
5838
5681
if (server_need_restart($tinfo , $server , $master_restarted ))
5839
5682
{
@@ -5855,8 +5698,7 @@ ($)
5855
5698
sub ndbds { return _like(' cluster_config.ndbd.' );}
5856
5699
sub ndb_mgmds { return _like(' cluster_config.ndb_mgmd.' ); }
5857
5700
sub clusters { return _like(' mysql_cluster.' ); }
5858
- sub memcacheds { return _like(' memcached.' ); }
5859
- sub all_servers { return ( mysqlds(), ndb_mgmds(), ndbds(), memcacheds() ); }
5701
+ sub all_servers { return ( mysqlds(), ndb_mgmds(), ndbds() ); }
5860
5702
5861
5703
#
5862
5704
# Filter a list of servers and return only those that are part
@@ -5938,7 +5780,7 @@ ($$)
5938
5780
5939
5781
# cluster processes
5940
5782
My::SafeProcess::shutdown ( $opt_shutdown_timeout ,
5941
- started(ndbds(), ndb_mgmds(), memcacheds() ) );
5783
+ started(ndbds(), ndb_mgmds()) );
5942
5784
}
5943
5785
else
5944
5786
{
@@ -6132,22 +5974,6 @@ ($)
6132
5974
}
6133
5975
}
6134
5976
6135
- # Start memcached(s) for each cluster
6136
- foreach my $cluster ( clusters() )
6137
- {
6138
- next if !in_cluster($cluster , memcacheds());
6139
-
6140
- # Load the memcache metadata into this cluster
6141
- memcached_load_metadata($cluster );
6142
-
6143
- # Start memcached(s)
6144
- foreach my $memcached ( in_cluster($cluster , memcacheds()))
6145
- {
6146
- next if started($memcached );
6147
- memcached_start($cluster , $memcached );
6148
- }
6149
- }
6150
-
6151
5977
return 0;
6152
5978
}
6153
5979
0 commit comments