mirror of
https://github.com/cubefs/cubefs.git
synced 2026-08-02 02:00:56 +00:00
fix(metanode): replace runtime.GC with debug.OsFreeMemory.#1000228535
The runtime.GC may cause metanode lose heartbeat. Signed-off-by: Wu Huocheng <wuhuocheng@oppo.com>
This commit is contained in:
parent
3264a846e5
commit
503a930226
@ -22,7 +22,6 @@ import (
|
||||
"net"
|
||||
"os"
|
||||
"path"
|
||||
"runtime"
|
||||
"runtime/debug"
|
||||
"strconv"
|
||||
"strings"
|
||||
@ -3174,8 +3173,10 @@ func (m *metadataManager) opBackupEmptyMetaPartition(conn net.Conn,
|
||||
|
||||
p.PacketOkReply()
|
||||
m.respondToClientWithVer(conn, p)
|
||||
runtime.GC()
|
||||
log.LogInfof("%s [opDeleteMetaPartition] req: %d - %v, resp: %v",
|
||||
go func() {
|
||||
debug.FreeOSMemory()
|
||||
}()
|
||||
log.LogInfof("%s [opBackupEmptyMetaPartition] req: %d - %v, resp: %v",
|
||||
remoteAddr, p.GetReqID(), req, err)
|
||||
return
|
||||
}
|
||||
|
||||
@ -742,6 +742,14 @@ func (p *Packet) GetOpMsg() (m string) {
|
||||
m = "OpFlashNodeTaskCommand"
|
||||
case OpSetRepairingStatus:
|
||||
m = "OpSetRepairingStatus"
|
||||
case OpFreezeEmptyMetaPartition:
|
||||
m = "OpFreezeEmptyMetaPartition"
|
||||
case OpBackupEmptyMetaPartition:
|
||||
m = "OpBackupEmptyMetaPartition"
|
||||
case OpRemoveBackupMetaPartition:
|
||||
m = "OpRemoveBackupMetaPartition"
|
||||
case OpIsRaftStatusOk:
|
||||
m = "OpIsRaftStatusOk"
|
||||
default:
|
||||
m = fmt.Sprintf("op:%v not found", p.Opcode)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user