Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.5.0 doesn't support SphinxSE #379

Closed
sanikolaev opened this issue Jul 28, 2020 · 2 comments
Closed

3.5.0 doesn't support SphinxSE #379

sanikolaev opened this issue Jul 28, 2020 · 2 comments
Labels

Comments

@sanikolaev
Copy link
Collaborator

sanikolaev commented Jul 28, 2020

Protocol autodetection introduced in 3.5.0 broke integration with SphinxSE, because the server expects the client (SphinxSE mysql engine) to send smth to detect the protocol, but SphinxSE just opens a connection and waits, then a timeout occurs:

Table in MariaDB:

CREATE TABLE `t2` (  
  `id` bigint(20) unsigned NOT NULL,  
  `weight` int(11) NOT NULL,  
  `query` varchar(3072) NOT NULL,  
  `group_id` int(11) DEFAULT NULL,  
  KEY `query` (`query`(768))  
) ENGINE=SPHINX DEFAULT CHARSET=utf8mb4 CONNECTION='sphinx://localhost:9312/test'  

Fail on select:

MariaDB [test]> reset query cache; SELECT * FROM t2 WHERE query='abc;mode=any';  
Query OK, 0 rows affected (0.000 sec)  
  
ERROR 1429 (HY000): Unable to connect to foreign data source: failed to receive searchd version (host=localhost, port=9312)  

TCP:

root@de5b82db934c:/# tshark -i lo  
Running as user "root" and group "root". This could be dangerous.  
Capturing on 'Loopback: lo'  
    1 0.000000000    127.0.0.1 ? 127.0.0.1    TCP 74 38090 ? 9312 [SYN] Seq=0 Win=43690 Len=0 MSS=65495 SACK_PERM=1 TSval=2245266117 TSecr=0 WS=128  
    2 0.000017925    127.0.0.1 ? 127.0.0.1    TCP 74 9312 ? 38090 [SYN, ACK] Seq=0 Ack=1 Win=43690 Len=0 MSS=65495 SACK_PERM=1 TSval=2245266117 TSecr=2245266117 WS=128  
    3 0.000038199    127.0.0.1 ? 127.0.0.1    TCP 66 38090 ? 9312 [ACK] Seq=1 Ack=1 Win=43776 Len=0 TSval=2245266117 TSecr=2245266117  
    4 5.004664723    127.0.0.1 ? 127.0.0.1    TCP 66 9312 ? 38090 [FIN, ACK] Seq=1 Ack=1 Win=43776 Len=0 TSval=2245271121 TSecr=2245266117  
    5 5.004720188    127.0.0.1 ? 127.0.0.1    TCP 66 38090 ? 9312 [FIN, ACK] Seq=1 Ack=2 Win=43776 Len=0 TSval=2245271121 TSecr=2245271121  
    6 5.004737245    127.0.0.1 ? 127.0.0.1    TCP 66 9312 ? 38090 [ACK] Seq=2 Ack=2 Win=43776 Len=0 TSval=2245271121 TSecr=2245271121  

The idea is to add a new listen protocol "sphinxse" especially for SphinxSE.

@sanikolaev sanikolaev added the bug label Jul 28, 2020
@githubmanticore
Copy link
Contributor

Bypass for SphinxSE

That is kind of 'gray area' in sphinx binary protocol handshake, namely:
who speaks first after connect? Usually order is not important, just the
fact that both send the handshake. But SpinxSE explicitly wait daemon
to speak first.

That fixes #379 on github, and fixes #1520 via commit c385c41

klirichek pushed a commit that referenced this issue Jul 28, 2020
Sphinxse fix

Closes #1520 and #379

See merge request manticoresearch/dev!89
@githubmanticore
Copy link
Contributor

Merge branch 'sphinxse_fix' into 'master'

Sphinxse fix

Closes #1520 and #379

See merge request manticoresearch/dev!89 via commit 4962b10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants