write action data before writing it to the action log - this reverts to previous behavior which was much easier to debug

This commit is contained in:
Mike Solomon 2012-12-11 00:26:54 -08:00
Родитель 7ad995e182
Коммит e034766541
2 изменённых файлов: 8 добавлений и 3 удалений

Просмотреть файл

@ -212,10 +212,15 @@ func StoreActionResponse(zconn zk.Conn, actionNode *ActionNode, actionPath strin
actionNode.State = ACTION_STATE_DONE
}
// and write the data
// Write the data first to our action node, then to the log.
// In the error case, this node will be left behind to debug.
data := ActionNodeToJson(actionNode)
_, err := zconn.Set(actionPath, data, -1)
if err != nil {
return err
}
actionLogPath := ActionToActionLogPath(actionPath)
_, err := zk.CreateRecursive(zconn, actionLogPath, data, 0, zookeeper.WorldACL(zookeeper.PERM_ALL))
_, err = zk.CreateRecursive(zconn, actionLogPath, data, 0, zookeeper.WorldACL(zookeeper.PERM_ALL))
return err
}

Просмотреть файл

@ -182,7 +182,7 @@ func FindAllTabletAliasesInShard(zconn zk.Conn, zkShardPath string) ([]TabletAli
aliases := make([]TabletAlias, 0, len(children))
for _, child := range children {
alias := path.Base(child)
if strings.Contains(alias, "action") {
if strings.HasPrefix(alias, "action") {
continue
}
zkTabletReplicationPath := path.Join(zkShardPath, child)