Opened 8 years ago

Last modified 8 months ago

#711 new enhancement

Remote protocol with support for selection of database directory

Reported by: German M. Bravo Owned by: Olly Betts
Priority: low Milestone: 2.0.0
Component: Backend-Remote Version: git master
Severity: normal Keywords:
Cc: Blocked By:
Blocking: Operating System: All

Description

If the user requests to open a remote database server, it could optionally require the remote backend to tell the server what database it wants to open; this is in case the remote server is configured as a server without a default directory (xapian-tcpsrv remains to always have a default directory at the moment).

The binary protocol was changed in the way that a new command can be sent to the server (MSG_READACCESS) in case the server tells the client no default directory is selected, the server then reacts to this command by opening and selecting the requested database as the active database. MSG_WRITEACCESS also could select a custom directory for write access.

The implementation of a way of telling a remote protocol server to select the active read or write database is desirable for allowing integrations to expose a custom remote server protocol which will permit the creation of full-blown xapian servers with remote or clustering support to efficiently access indexes remotely. An example of such kind of server is Xapiand ​https://github.com/Kronuz/Xapiand, and this ticket complements ticket #710.

Attachments (3)

remote_protocol_msg_readaccess_select.diff (26.2 KB ) - added by German M. Bravo 8 years ago.
711-remote_protocol_msg_readaccess_select.diff (26.2 KB ) - added by German M. Bravo 8 years ago.
711-remote_database_directory_selection.diff (25.5 KB ) - added by German M. Bravo 8 years ago.
This passes all tests

Download all attachments as: .zip

Change History (10)

by German M. Bravo, 8 years ago

comment:1 by Olly Betts, 8 years ago

Component: Backend-GlassBackend-Remote
Version: git master

Allowing the client to specify the full path for the server to open seems rather unwise. I think the database path the client specifies needs to be forced to be below a directory specified on the server's command line.

by German M. Bravo, 8 years ago

by German M. Bravo, 8 years ago

This passes all tests

comment:2 by German M. Bravo, 8 years ago

This patch breaks the 1.3 ABI as it changes the Remote::open_writable() and Remote::open() to both receive flags and dir.

comment:3 by Olly Betts, 8 years ago

Milestone: 1.4.x

The current patch does, but leaving the current functions as-is and adding a second overloaded form would avoid breaking the ABI, so this can wait until after 1.4.0.

comment:4 by German M. Bravo, 8 years ago

This is an API and ABI compatible patch for v1.4.0, implementing what's suggested in this ticket.

EDIT: Sorry, this is the link: https://github.com/Kronuz/xapian/commit/89792af678baa27fcd2dc1650e65ce88e07b91a1

Last edited 8 years ago by German M. Bravo (previous) (diff)

comment:5 by Olly Betts, 23 months ago

Allowing the client to specify the full path for the server to open seems rather unwise. I think the database path the client specifies needs to be forced to be below a directory specified on the server's command line.

This doesn't seem to have been addressed.

I think this is important to provide. If people really want to allow trying to open any path on the filing system of the server as a Xapian database they can specify / for this directory on the server's command line to explicitly say that's what they want.

This passes all tests

There are however no tests added for the new functionality. Any new feature should really have a feature test so we have some confidence that it actually works, and especially that it will continue to work in the face of future patches. If there's no feature test it could be completely broken and we'd have no idea until we receive a bug report about it.

comment:6 by Olly Betts, 19 months ago

Milestone: 1.4.x
Priority: highlow

This patch still needs work (security issues addressing, and test coverage adding) but seems to have been abandoned.

The motivation of this being useful to xapiand no longer seems relevant as xapiand sadly seems to be an inactive project, but the requirement for one remote server instance per remote database served has been flagged as annoying by at least one Xapian user.

So I'm not going to just close this ticket, but adjusting metadata to reflect reality.

comment:7 by Olly Betts, 8 months ago

Milestone: 2.0.0
Note: See TracTickets for help on using tickets.