get wrong parents bucket in withSnapshotBucket

improve error message for CommitActive
Signed-off-by: yason <yan.xuean@zte.com.cn>
This commit is contained in:
yason
2017-12-02 22:10:11 +08:00
parent fe4e30cbb7
commit db742c90c0
2 changed files with 13 additions and 13 deletions

View File

@@ -287,9 +287,9 @@ func (o *snapshotter) createSnapshot(ctx context.Context, kind snapshots.Kind, k
if err != nil {
return nil, err
}
isRollback := true
rollback := true
defer func() {
if isRollback {
if rollback {
if rerr := t.Rollback(); rerr != nil {
log.G(ctx).WithError(rerr).Warn("failed to rollback transaction")
}
@@ -317,9 +317,9 @@ func (o *snapshotter) createSnapshot(ctx context.Context, kind snapshots.Kind, k
if err = os.Rename(td, path); err != nil {
return nil, errors.Wrap(err, "failed to rename")
}
isRollback = false
td = ""
rollback = false
if err = t.Commit(); err != nil {
return nil, errors.Wrap(err, "commit failed")
}