We need to periodically flush the GC or we'll end up blocking with a huge backlog at the end of load

Former-commit-id: 29c0bf79ad1a810e808790de2f7db24f3cc603e8
This commit is contained in:
John Sully 2021-07-19 16:50:48 +00:00
parent fc7221739c
commit a3cf05574f

View File

@ -2884,6 +2884,8 @@ int rdbLoadRio(rio *rdb, int rdbflags, rdbSaveInfo *rsi) {
do this every 16 keys to limit the perf impact */
if (g_pserver->m_pstorageFactory && (ckeysLoaded % 128) == 0)
{
g_pserver->garbageCollector.endEpoch(serverTL->gcEpoch);
serverTL->gcEpoch = g_pserver->garbageCollector.startEpoch();
bool fHighMemory = (getMaxmemoryState(NULL,NULL,NULL,NULL) != C_OK);
if (fHighMemory || (ckeysLoaded % (1024)) == 0)
{