Commit e61e6494 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 62af029d
......@@ -90,6 +90,7 @@ func (ovl *Storage) Load(ctx context.Context, xid zodb.Xid) (_ *mem.Buf, _ zodb.
}
useBase := false
inδ := false
var eNoData *zodb.NoDataError
var eNoObject *zodb.NoObjectError
switch {
......@@ -98,8 +99,9 @@ func (ovl *Storage) Load(ctx context.Context, xid zodb.Xid) (_ *mem.Buf, _ zodb.
// object deleted in δ -> whiteout
return data, serial, eNoData
} else {
// object not created in δ
// object present in δ but not yet created as of xid.at
useBase = true
inδ = true
}
case errors.As(err, &eNoObject):
......@@ -121,7 +123,12 @@ func (ovl *Storage) Load(ctx context.Context, xid zodb.Xid) (_ *mem.Buf, _ zodb.
case errors.As(err, &eNoData):
err = eNoData
case errors.As(err, &eNoObject):
err = eNoObject
if !inδ {
err = eNoObject
} else {
// object is present in δ
err = &zodb.NoDataError{Oid: xid.Oid, DeletedAt: 0}
}
}
return data, serial, err
......
......@@ -102,7 +102,7 @@ func withDemoData(t *testing.T, f func(t *testing.T, ddat *DemoData), optv ...tO
// verify on all combinations of preload being split into base+δ
work := xtempdir(t)
//defer os.RemoveAll(work)
defer os.RemoveAll(work)
test1 := func(δstart zodb.Tid, zdumpBase, zdumpδ string) {
t.Helper()
t.Run(fmt.Sprintf("δstart=%s", δstart), func(t *testing.T) {
......
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