Skip to content

Commit

Permalink
Add txn manager debug statements
Browse files Browse the repository at this point in the history
  • Loading branch information
saurav-c committed Apr 23, 2021
1 parent 837b4d0 commit c1c1b83
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 11 additions & 1 deletion cluster/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import util
from routing_util import register, deregister
import subprocess
import time

# AWS Info
aws_key_id = util.check_or_get_env_arg('AWS_ACCESS_KEY_ID')
Expand Down Expand Up @@ -70,7 +71,16 @@ def restart(pod_ip, kind):
pod_ips = util.get_pod_ips(client, selector='role='+kind, is_running=True)

# Send config file to the pod
sendConfig(pod_ip, None)
retry = 0
while retry < 5:
try:
sendConfig(pod_ip, None)
except Exception as e:
retry += 1
print('Caught exception: ' + e)
print('Retrying in %d sec' % retry * 5)
time.sleep(retry * 5)


print('Restarted %s node at %s' % (kind, pod_ip))

Expand Down
4 changes: 3 additions & 1 deletion cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ func (t *TxnManager) collectEndTxnResponses(endRespChan chan *tpb.TransactionTag
}

func (t *TxnManager) writeToStorage(tid string, endTs int64, entry *WriteBufferEntry, writeChan chan bool) {
go t.Monitor.TrackFuncExecTime(tid, "Write to Storage time", time.Now())
defer t.Monitor.TrackFuncExecTime(tid, "Write to Storage time", time.Now())

dbKeys := make([]string, len(entry.buffer)+1)
dbVals := make([][]byte, len(entry.buffer)+1)
Expand All @@ -372,7 +372,9 @@ func (t *TxnManager) writeToStorage(tid string, endTs int64, entry *WriteBufferE
dbKeys[i] = tid
dbVals[i] = data

log.Debugf("Sent storage write for txn %s", tid)
t.StorageManager.MultiPut(dbKeys, dbVals)
log.Debugf("Storage returned for txn %s", tid)
writeChan <- true
}

Expand Down

0 comments on commit c1c1b83

Please sign in to comment.