Change the order of start startLoadingFile call in redis-check-rdb. (#8676)

redis_check_rdb in some scenarios only stopLoading is called because
startLoadingFile is called too late.
This commit is contained in:
Huang Zhw 2021-03-22 15:18:56 +08:00 committed by GitHub
parent 9ae4f5c73d
commit 0418253a9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -192,6 +192,7 @@ int redis_check_rdb(char *rdbfilename, FILE *fp) {
int closefile = (fp == NULL);
if (fp == NULL && (fp = fopen(rdbfilename,"r")) == NULL) return 1;
startLoadingFile(fp, rdbfilename, RDBFLAGS_NONE);
rioInitWithFile(&rdb,fp);
rdbstate.rio = &rdb;
rdb.update_cksum = rdbLoadProgressCallback;
@ -208,7 +209,6 @@ int redis_check_rdb(char *rdbfilename, FILE *fp) {
}
expiretime = -1;
startLoadingFile(fp, rdbfilename, RDBFLAGS_NONE);
while(1) {
robj *key, *val;