The Query() and Execute() functions on the Store now take a complex type
that encapsulates the statements, and associated parameters. This will
make it easier to add more control parameters when making requests.
The main rqlite code needs this logic to check if the Discovery Service
should even be accessed. This code makes assumptions about how the Raft
module works, which is subject to change. The new unit tests should
capture that.
Writing a sufficiently sophisicated parser is too much work, and unlikely to be successful soon. Instead this change simply loads the entire dump as one command, and allows the underlying SQLite support to parse it correctly. This will definitely work, but since the load goes over Raft, it may hit limits with regards to network transfer sizes. Right now any limitations in that area are unknown.
Therefore this functionality remains somewhat experimental.
This allows us to grab a raw snapshot of the databse.
v2: s/RawDBSnapshot/Database, remove reference to raft from the comment.
v3: add a leader arg to Database to do a leader check
v4: fix doc string.
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
This is useful in case the server needs to store other metadata (e.g. auth
data) along side the peer list.
The logging bit is handy in case something has its own logging framework
that it wants to use.
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>