Commit d0e9e21f authored by liuyuhang's avatar liuyuhang Committed by vipwzw

modify log level

parent 01f6506d
...@@ -116,7 +116,7 @@ func (mvccs *KVMVCCStore) Get(datas *types.StoreGet) [][]byte { ...@@ -116,7 +116,7 @@ func (mvccs *KVMVCCStore) Get(datas *types.StoreGet) [][]byte {
func (mvccs *KVMVCCStore) MemSet(datas *types.StoreSet, hash []byte, sync bool) ([]byte, error) { func (mvccs *KVMVCCStore) MemSet(datas *types.StoreSet, hash []byte, sync bool) ([]byte, error) {
beg := types.Now() beg := types.Now()
defer func() { defer func() {
kmlog.Info("kvmvcc MemSet", "cost", types.Since(beg)) kmlog.Debug("kvmvcc MemSet", "cost", types.Since(beg))
}() }()
kvset, err := mvccs.checkVersion(datas.Height) kvset, err := mvccs.checkVersion(datas.Height)
if err != nil { if err != nil {
...@@ -150,7 +150,7 @@ func (mvccs *KVMVCCStore) MemSet(datas *types.StoreSet, hash []byte, sync bool) ...@@ -150,7 +150,7 @@ func (mvccs *KVMVCCStore) MemSet(datas *types.StoreSet, hash []byte, sync bool)
func (mvccs *KVMVCCStore) Commit(req *types.ReqHash) ([]byte, error) { func (mvccs *KVMVCCStore) Commit(req *types.ReqHash) ([]byte, error) {
beg := types.Now() beg := types.Now()
defer func() { defer func() {
kmlog.Info("kvmvcc Commit", "cost", types.Since(beg)) kmlog.Debug("kvmvcc Commit", "cost", types.Since(beg))
}() }()
_, ok := mvccs.kvsetmap[string(req.Hash)] _, ok := mvccs.kvsetmap[string(req.Hash)]
if !ok { if !ok {
......
...@@ -94,7 +94,7 @@ func (mavls *MavlStore) Get(datas *types.StoreGet) [][]byte { ...@@ -94,7 +94,7 @@ func (mavls *MavlStore) Get(datas *types.StoreGet) [][]byte {
func (mavls *MavlStore) MemSet(datas *types.StoreSet, sync bool) ([]byte, error) { func (mavls *MavlStore) MemSet(datas *types.StoreSet, sync bool) ([]byte, error) {
beg := types.Now() beg := types.Now()
defer func() { defer func() {
kmlog.Info("mavl MemSet", "cost", types.Since(beg)) kmlog.Debug("mavl MemSet", "cost", types.Since(beg))
}() }()
if len(datas.KV) == 0 { if len(datas.KV) == 0 {
kmlog.Info("store mavl memset,use preStateHash as stateHash for kvset is null") kmlog.Info("store mavl memset,use preStateHash as stateHash for kvset is null")
...@@ -119,7 +119,7 @@ func (mavls *MavlStore) MemSet(datas *types.StoreSet, sync bool) ([]byte, error) ...@@ -119,7 +119,7 @@ func (mavls *MavlStore) MemSet(datas *types.StoreSet, sync bool) ([]byte, error)
func (mavls *MavlStore) MemSetUpgrade(datas *types.StoreSet, sync bool) ([]byte, error) { func (mavls *MavlStore) MemSetUpgrade(datas *types.StoreSet, sync bool) ([]byte, error) {
beg := types.Now() beg := types.Now()
defer func() { defer func() {
kmlog.Info("mavl MemSet", "cost", types.Since(beg)) kmlog.Debug("mavl MemSet", "cost", types.Since(beg))
}() }()
if len(datas.KV) == 0 { if len(datas.KV) == 0 {
kmlog.Info("store mavl memset,use preStateHash as stateHash for kvset is null") kmlog.Info("store mavl memset,use preStateHash as stateHash for kvset is null")
...@@ -142,7 +142,7 @@ func (mavls *MavlStore) MemSetUpgrade(datas *types.StoreSet, sync bool) ([]byte, ...@@ -142,7 +142,7 @@ func (mavls *MavlStore) MemSetUpgrade(datas *types.StoreSet, sync bool) ([]byte,
func (mavls *MavlStore) Commit(req *types.ReqHash) ([]byte, error) { func (mavls *MavlStore) Commit(req *types.ReqHash) ([]byte, error) {
beg := types.Now() beg := types.Now()
defer func() { defer func() {
kmlog.Info("mavl Commit", "cost", types.Since(beg)) kmlog.Debug("mavl Commit", "cost", types.Since(beg))
}() }()
tree, ok := mavls.trees.Load(string(req.Hash)) tree, ok := mavls.trees.Load(string(req.Hash))
if !ok { if !ok {
...@@ -167,7 +167,7 @@ func (mavls *MavlStore) Commit(req *types.ReqHash) ([]byte, error) { ...@@ -167,7 +167,7 @@ func (mavls *MavlStore) Commit(req *types.ReqHash) ([]byte, error) {
func (mavls *MavlStore) Rollback(req *types.ReqHash) ([]byte, error) { func (mavls *MavlStore) Rollback(req *types.ReqHash) ([]byte, error) {
beg := types.Now() beg := types.Now()
defer func() { defer func() {
kmlog.Info("Rollback", "cost", types.Since(beg)) kmlog.Debug("Rollback", "cost", types.Since(beg))
}() }()
_, ok := mavls.trees.Load(string(req.Hash)) _, ok := mavls.trees.Load(string(req.Hash))
if !ok { if !ok {
......
...@@ -225,7 +225,7 @@ func (t *Tree) Save() []byte { ...@@ -225,7 +225,7 @@ func (t *Tree) Save() []byte {
beg := types.Now() beg := types.Now()
err := t.ndb.Commit() err := t.ndb.Commit()
treelog.Info("tree.commit", "cost", types.Since(beg)) treelog.Debug("tree.commit", "cost", types.Since(beg))
if err != nil { if err != nil {
return nil return nil
} }
......
...@@ -126,7 +126,7 @@ func (mavls *Store) Get(datas *types.StoreGet) [][]byte { ...@@ -126,7 +126,7 @@ func (mavls *Store) Get(datas *types.StoreGet) [][]byte {
func (mavls *Store) MemSet(datas *types.StoreSet, sync bool) ([]byte, error) { func (mavls *Store) MemSet(datas *types.StoreSet, sync bool) ([]byte, error) {
beg := types.Now() beg := types.Now()
defer func() { defer func() {
mlog.Info("MemSet", "cost", types.Since(beg)) mlog.Debug("MemSet", "cost", types.Since(beg))
}() }()
if len(datas.KV) == 0 { if len(datas.KV) == 0 {
mlog.Info("store mavl memset,use preStateHash as stateHash for kvset is null") mlog.Info("store mavl memset,use preStateHash as stateHash for kvset is null")
...@@ -151,7 +151,7 @@ func (mavls *Store) MemSet(datas *types.StoreSet, sync bool) ([]byte, error) { ...@@ -151,7 +151,7 @@ func (mavls *Store) MemSet(datas *types.StoreSet, sync bool) ([]byte, error) {
func (mavls *Store) Commit(req *types.ReqHash) ([]byte, error) { func (mavls *Store) Commit(req *types.ReqHash) ([]byte, error) {
beg := types.Now() beg := types.Now()
defer func() { defer func() {
mlog.Info("Commit", "cost", types.Since(beg)) mlog.Debug("Commit", "cost", types.Since(beg))
}() }()
tree, ok := mavls.trees.Load(string(req.Hash)) tree, ok := mavls.trees.Load(string(req.Hash))
if !ok { if !ok {
...@@ -176,7 +176,7 @@ func (mavls *Store) Commit(req *types.ReqHash) ([]byte, error) { ...@@ -176,7 +176,7 @@ func (mavls *Store) Commit(req *types.ReqHash) ([]byte, error) {
func (mavls *Store) MemSetUpgrade(datas *types.StoreSet, sync bool) ([]byte, error) { func (mavls *Store) MemSetUpgrade(datas *types.StoreSet, sync bool) ([]byte, error) {
beg := types.Now() beg := types.Now()
defer func() { defer func() {
mlog.Info("MemSet", "cost", types.Since(beg)) mlog.Debug("MemSet", "cost", types.Since(beg))
}() }()
if len(datas.KV) == 0 { if len(datas.KV) == 0 {
mlog.Info("store mavl memset,use preStateHash as stateHash for kvset is null") mlog.Info("store mavl memset,use preStateHash as stateHash for kvset is null")
...@@ -205,7 +205,7 @@ func (mavls *Store) CommitUpgrade(req *types.ReqHash) ([]byte, error) { ...@@ -205,7 +205,7 @@ func (mavls *Store) CommitUpgrade(req *types.ReqHash) ([]byte, error) {
func (mavls *Store) Rollback(req *types.ReqHash) ([]byte, error) { func (mavls *Store) Rollback(req *types.ReqHash) ([]byte, error) {
beg := types.Now() beg := types.Now()
defer func() { defer func() {
mlog.Info("Rollback", "cost", types.Since(beg)) mlog.Debug("Rollback", "cost", types.Since(beg))
}() }()
_, ok := mavls.trees.Load(string(req.Hash)) _, ok := mavls.trees.Load(string(req.Hash))
if !ok { if !ok {
......
...@@ -252,7 +252,7 @@ func ExecBlock(client queue.Client, prevStateRoot []byte, block *types.Block, er ...@@ -252,7 +252,7 @@ func ExecBlock(client queue.Client, prevStateRoot []byte, block *types.Block, er
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
} }
ulog.Info("ExecBlock", "CheckTxDup", types.Since(beg)) ulog.Debug("ExecBlock", "CheckTxDup", types.Since(beg))
beg = types.Now() beg = types.Now()
newtxscount := len(cacheTxs) newtxscount := len(cacheTxs)
if oldtxscount != newtxscount && errReturn { if oldtxscount != newtxscount && errReturn {
...@@ -265,7 +265,7 @@ func ExecBlock(client queue.Client, prevStateRoot []byte, block *types.Block, er ...@@ -265,7 +265,7 @@ func ExecBlock(client queue.Client, prevStateRoot []byte, block *types.Block, er
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
} }
ulog.Info("ExecBlock", "ExecTx", types.Since(beg)) ulog.Debug("ExecBlock", "ExecTx", types.Since(beg))
beg = types.Now() beg = types.Now()
var kvset []*types.KeyValue var kvset []*types.KeyValue
var deltxlist = make(map[int]bool) var deltxlist = make(map[int]bool)
...@@ -309,7 +309,7 @@ func ExecBlock(client queue.Client, prevStateRoot []byte, block *types.Block, er ...@@ -309,7 +309,7 @@ func ExecBlock(client queue.Client, prevStateRoot []byte, block *types.Block, er
if errReturn && !bytes.Equal(calcHash, block.TxHash) { if errReturn && !bytes.Equal(calcHash, block.TxHash) {
return nil, nil, types.ErrCheckTxHash return nil, nil, types.ErrCheckTxHash
} }
ulog.Info("ExecBlock", "CalcMerkleRootCache", types.Since(beg)) ulog.Debug("ExecBlock", "CalcMerkleRootCache", types.Since(beg))
beg = types.Now() beg = types.Now()
block.TxHash = calcHash block.TxHash = calcHash
var detail types.BlockDetail var detail types.BlockDetail
...@@ -340,7 +340,7 @@ func ExecBlock(client queue.Client, prevStateRoot []byte, block *types.Block, er ...@@ -340,7 +340,7 @@ func ExecBlock(client queue.Client, prevStateRoot []byte, block *types.Block, er
return nil, deltx, err return nil, deltx, err
} }
} }
ulog.Info("ExecBlock", "CheckBlock", types.Since(beg)) ulog.Debug("ExecBlock", "CheckBlock", types.Since(beg))
// 写数据库失败时需要及时返回错误,防止错误数据被写入localdb中CHAIN33-567 // 写数据库失败时需要及时返回错误,防止错误数据被写入localdb中CHAIN33-567
err = ExecKVSetCommit(client, block.StateHash, false) err = ExecKVSetCommit(client, block.StateHash, false)
if err != nil { if err != nil {
...@@ -371,7 +371,7 @@ func ExecBlockUpgrade(client queue.Client, prevStateRoot []byte, block *types.Bl ...@@ -371,7 +371,7 @@ func ExecBlockUpgrade(client queue.Client, prevStateRoot []byte, block *types.Bl
if err != nil { if err != nil {
return err return err
} }
ulog.Info("ExecBlockUpgrade", "ExecTx", types.Since(beg)) ulog.Debug("ExecBlockUpgrade", "ExecTx", types.Since(beg))
beg = types.Now() beg = types.Now()
var kvset []*types.KeyValue var kvset []*types.KeyValue
for i := 0; i < len(receipts.Receipts); i++ { for i := 0; i < len(receipts.Receipts); i++ {
...@@ -387,7 +387,7 @@ func ExecBlockUpgrade(client queue.Client, prevStateRoot []byte, block *types.Bl ...@@ -387,7 +387,7 @@ func ExecBlockUpgrade(client queue.Client, prevStateRoot []byte, block *types.Bl
if !bytes.Equal(block.StateHash, calcHash) { if !bytes.Equal(block.StateHash, calcHash) {
return types.ErrCheckStateHash return types.ErrCheckStateHash
} }
ulog.Info("ExecBlockUpgrade", "CheckBlock", types.Since(beg)) ulog.Debug("ExecBlockUpgrade", "CheckBlock", types.Since(beg))
// 写数据库失败时需要及时返回错误,防止错误数据被写入localdb中CHAIN33-567 // 写数据库失败时需要及时返回错误,防止错误数据被写入localdb中CHAIN33-567
err = ExecKVSetCommit(client, calcHash, true) err = ExecKVSetCommit(client, calcHash, true)
return err return err
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment