Add Redis Sentinel based database discovery 64/964/1
authorRolf Badorek <rolf.badorek@nokia.com>
Tue, 17 Sep 2019 13:47:20 +0000 (16:47 +0300)
committerRolf Badorek <rolf.badorek@nokia.com>
Tue, 17 Sep 2019 13:47:20 +0000 (16:47 +0300)
commit8324d029ce006509ddbc605446d05987c17e0368
treeeabf081fca7b4455fb7ca37200a6a1264b311fbd
parentef2bf51d04aaf01fa0cabdcaf905b23423067662
Add Redis Sentinel based database discovery

This is first step to support forthcoming Redis HA (Sentinel) DBaaS
deployment.

If sentinel-based database discovery is used (currently still disabled
by configure option), current master is asked from Sentinel.

In case that Sentinel can't be connected, re-try will be triggered
after one second delay. If reply parsing fails, it is considered as
non-recoverable bug and execution is aborted.

Currently, Sentinel address and Redis master name are still hard coded,
will be made configurable in a separate commit soon. Also ordering
change notifications from Sentinel will be implemented separately.

Added new discovery type "SENTINEL" to 'sdltool test-connectivity'
command output.

Refactoring for 'AsyncStorageImpl' class unit tests, so that those will
use database discovery mock implementation. Earlier implementation did
have assumptions for database discovery behavior, which were not
fulfilled any more when sentinel database discovery is used.

Added option to 'AsyncCommandDispatcher' which defines if commands
will be sent to Redis or to Sentinel. In latter case existence checking
for Redis module extension commands is skipped.

Signed-off-by: Rolf Badorek <rolf.badorek@nokia.com>
Change-Id: Id7507844c9b74115e52d6f8eaf9cb18198c5dc63
17 files changed:
Makefile.am
configure.ac
include/private/asyncstorageimpl.hpp
include/private/redis/asynccommanddispatcher.hpp
include/private/redis/asynchirediscommanddispatcher.hpp
include/private/redis/asyncsentineldatabasediscovery.hpp [new file with mode: 0644]
include/private/redis/databaseinfo.hpp
src/asyncstorageimpl.cpp
src/cli/testconnectivitycommand.cpp
src/redis/asynccommanddispatcher.cpp
src/redis/asyncdatabasediscovery.cpp
src/redis/asynchirediscommanddispatcher.cpp
src/redis/asyncredisstorage.cpp
src/redis/asyncsentineldatabasediscovery.cpp [new file with mode: 0644]
tst/asynchirediscommanddispatcher_test.cpp
tst/asyncsentineldatabasediscovery_test.cpp [new file with mode: 0644]
tst/asyncstorageimpl_test.cpp