summaryrefslogtreecommitdiff
path: root/storage/sphinx
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2019-10-01 10:50:32 +0400
committerAlexander Barkov <bar@mariadb.com>2019-10-01 11:44:27 +0400
commit1ae09ec8636be184d8a1017381a7d533f2bb29c9 (patch)
tree7723af89a724cb6337e480ac31621c33d0056584 /storage/sphinx
parent4cd79588deb1b49499ff1f49bcf7f17f00eb241a (diff)
parentdc588e3d3fc0d3610ffb6f4e9c804dc539394669 (diff)
downloadmariadb-git-1ae09ec8636be184d8a1017381a7d533f2bb29c9.tar.gz
Merge remote-tracking branch 'origin/10.4' into 10.5
Diffstat (limited to 'storage/sphinx')
-rw-r--r--storage/sphinx/mysql-test/sphinx/disabled.def2
-rw-r--r--storage/sphinx/mysql-test/sphinx/suite.pm33
-rw-r--r--storage/sphinx/mysql-test/sphinx/union-5539.result2
3 files changed, 33 insertions, 4 deletions
diff --git a/storage/sphinx/mysql-test/sphinx/disabled.def b/storage/sphinx/mysql-test/sphinx/disabled.def
deleted file mode 100644
index a85b8b71e52..00000000000
--- a/storage/sphinx/mysql-test/sphinx/disabled.def
+++ /dev/null
@@ -1,2 +0,0 @@
-sphinx : MDEV-10986, MDEV-10985
-union-5539 : MDEV-10986, MDEV-10985
diff --git a/storage/sphinx/mysql-test/sphinx/suite.pm b/storage/sphinx/mysql-test/sphinx/suite.pm
index 24c377d7665..e44a8e626df 100644
--- a/storage/sphinx/mysql-test/sphinx/suite.pm
+++ b/storage/sphinx/mysql-test/sphinx/suite.pm
@@ -23,6 +23,8 @@ return "'indexer' binary not found" unless $exe_sphinx_indexer;
my $exe_sphinx_searchd = &locate_sphinx_binary('searchd');
return "'searchd' binary not found" unless $exe_sphinx_searchd;
+my $sphinx_config= "$::opt_vardir/my_sphinx.conf";
+
# Check for Sphinx engine
return "SphinxSE not found" unless $ENV{HA_SPHINX_SO} or $::mysqld_variables{'sphinx'} eq "ON";
@@ -95,11 +97,38 @@ sub searchd_start {
&::mtr_verbose("Started $sphinx->{proc}");
}
+sub wait_exp_backoff {
+ my $timeout= shift; # Seconds
+ my $start_wait= shift; # Seconds
+ my $scale_factor= shift;
+
+ $searchd_status= "$exe_sphinx_searchd --status" .
+ " --config $sphinx_config > /dev/null 2>&1";
+
+ my $scale= $start_wait;
+ my $total_sleep= 0;
+ while (1) {
+ my $status = system($searchd_status);
+ if (not $status) {
+ return 0;
+ }
+ if ($total_sleep >= $timeout) {
+ last;
+ }
+
+ &::mtr_milli_sleep($scale * 1000);
+ $total_sleep+= $scale;
+ $scale*= $scale_factor;
+ }
+
+ &::mtr_warning("Getting a response from searchd timed out");
+ return 1
+}
+
sub searchd_wait {
my ($sphinx) = @_; # My::Config::Group
- return not &::sleep_until_file_created($sphinx->value('pid_file'), 20,
- $sphinx->{'proc'})
+ return wait_exp_backoff(30, 0.1, 2)
}
############# declaration methods ######################
diff --git a/storage/sphinx/mysql-test/sphinx/union-5539.result b/storage/sphinx/mysql-test/sphinx/union-5539.result
index ab694b7db6a..945e0141b7b 100644
--- a/storage/sphinx/mysql-test/sphinx/union-5539.result
+++ b/storage/sphinx/mysql-test/sphinx/union-5539.result
@@ -5,10 +5,12 @@ id w query
2 1 ;mode=extended2;limit=1000000;maxmatches=500
3 1 ;mode=extended2;limit=1000000;maxmatches=500
4 1 ;mode=extended2;limit=1000000;maxmatches=500
+5 1 ;mode=extended2;limit=1000000;maxmatches=500
SELECT a.* FROM (SELECT * FROM ts si WHERE si.query='@* 123nothingtofind123;mode=extended2;limit=1000000;maxmatches=500') AS a UNION SELECT b.* FROM (SELECT * FROM ts si WHERE si.query=';mode=extended2;limit=1000000;maxmatches=500') AS b;
id w query
1 1 ;mode=extended2;limit=1000000;maxmatches=500
2 1 ;mode=extended2;limit=1000000;maxmatches=500
3 1 ;mode=extended2;limit=1000000;maxmatches=500
4 1 ;mode=extended2;limit=1000000;maxmatches=500
+5 1 ;mode=extended2;limit=1000000;maxmatches=500
drop table ts;