update comments

This commit is contained in:
finley
2022-07-03 18:03:30 +08:00
parent 45edbdd7c7
commit 47ec67c4dc
3 changed files with 3 additions and 2 deletions

View File

@@ -151,7 +151,7 @@ func (handler *Handler) FinishRewrite(ctx *RewriteCtx) {
} }
handler.aofFile = aofFile handler.aofFile = aofFile
// reset selected db 重新写入一次 select 指令保证 aof 中的数据库与 handler.currentDB 一致 // write select command again to ensure aof file has the same db index with handler.currentDB
data = protocol.MakeMultiBulkReply(utils.ToCmdLine("SELECT", strconv.Itoa(handler.currentDB))).ToBytes() data = protocol.MakeMultiBulkReply(utils.ToCmdLine("SELECT", strconv.Itoa(handler.currentDB))).ToBytes()
_, err = handler.aofFile.Write(data) _, err = handler.aofFile.Write(data)
if err != nil { if err != nil {

View File

@@ -294,7 +294,7 @@ func execKeys(db *DB, args [][]byte) redis.Reply {
func toTTLCmd(db *DB, key string) *protocol.MultiBulkReply { func toTTLCmd(db *DB, key string) *protocol.MultiBulkReply {
raw, exists := db.ttlMap.Get(key) raw, exists := db.ttlMap.Get(key)
if !exists { if !exists {
// TTL // has no TTL
return protocol.MakeMultiBulkReply(utils.ToCmdLine("PERSIST", key)) return protocol.MakeMultiBulkReply(utils.ToCmdLine("PERSIST", key))
} }
expireTime, _ := raw.(time.Time) expireTime, _ := raw.(time.Time)

View File

@@ -309,6 +309,7 @@ func (mdb *MultiDB) doPsync() error {
} }
// there is no CRLF between RDB and following AOF, reset stream to avoid parser error // there is no CRLF between RDB and following AOF, reset stream to avoid parser error
mdb.replication.masterChan = parser.ParseStream(mdb.replication.masterConn) mdb.replication.masterChan = parser.ParseStream(mdb.replication.masterConn)
// fixme: update aof file
return nil return nil
} }