yahoojapan / ngtd

Serving NGT over HTTP or gRPC ※This project is not maintained. We have moved to a new product, [Vald](https://vald.vdaas.org) .
Apache License 2.0
38 stars 10 forks source link

wait until redis finish load dump.rdb #16

Closed cloverrose closed 5 years ago

cloverrose commented 5 years ago

Hi, I deploy NGTD as stateless application with redis as db. It means I create NGT Index and Redis dump.rdb at first. Then copy dump.rdb to another server's /data directory and start redis-server. (and NGT Index too)

If dump.rdb is large, redis-server consumes 5~10 minutes to load data on memory. While loading data, redis can not return PONG, and it cause error at NewRedis

So I added busy loop for redis ping-pong.

It blocks NGTD's db independent initialization steps. But to care about faster initialization makes code complex. And In stateful case (I think it is main use case), such optimization makes no sense.

kpango commented 5 years ago

LGTM