8000 multi-object copy/transform: when targets run different UUIDs (corner) · NVIDIA/aistore@a592f87 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit a592f87

Browse files
committed
multi-object copy/transform: when targets run different UUIDs (corner)
* keywords: clock drift, cos.GenBEID Signed-off-by: Alex Aizman <alex.aizman@gmail.com>
1 parent 30cdc3f commit a592f87

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

ais/prxtxn.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,9 @@ func (p *proxy) tcobjs(bckFrom, bckTo *meta.Bck, config *cmn.Config, msg *apc.Ac
700700
}
701701

702702
if xid == "" {
703-
xid = strings.Join(all, xact.SepaID) // return comma-separated x-tco IDs
703+
// return comma-separated x-tco IDs
704+
// see x-tco for related: p.genBEID
705+
xid = strings.Join(all, xact.SepaID)
704706
}
705707
return xid, nil
706708
}

ais/tgtxact.go

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ package ais
77
import (
88
"fmt"
99
"net/http"
10+
"strings"
1011
"sync"
1112

1213
"github.com/NVIDIA/aistore/api/apc"
@@ -318,10 +319,24 @@ func (t *target) httpxpost(w http.ResponseWriter, r *http.Request) {
318319
}
319320

320321
xactID := amsg.Name
321-
if xctn, err = xreg.GetXact(xactID); err != nil {
322-
t.writeErr(w, r, err)
322+
if strings.IndexByte(xactID, xact.SepaID[0]) > 0 {
323+
uuids := strings.Split(xactID, xact.SepaID)
324+
for _, xid := range uuids {
325+
if xctn, err = xreg.GetXact(xid); err == nil {
326+
break
327+
}
328+
}
329+
} else {
330+
if xctn, err = xreg.GetXact(xactID); err != nil {
331+
t.writeErr(w, r, err)
332+
return
333+
}
334+
}
335+
if xctn == nil {
336+
t.writeErr(w, r, cos.NewErrNotFound(t, xactID), http.StatusNotFound)
323337
return
324338
}
339+
325340
xtco, ok := xctn.(*xs.XactTCO)
326341
debug.Assert(ok)
327342

0 commit comments

Comments
 (0)
0