Commit cd5bbb87 authored by Kirill Smelkov's avatar Kirill Smelkov

X go/neo: NEO/py represents data deletion by returning data=None

This fixes

	=== RUN   TestLoad/py
	    xtesting.go:297: load 0285cbacc06d3a4c:0000000000000007: returned err unexpected:
	        have: <nil>
	        want: neo://1@127.0.0.1:27145: load 0285cbacc06d3a4c:0000000000000007: 0000000000000007: object was deleted @0285cbacc06d3a4c
	    xtesting.go:297: load 0285cbacc06d3a4c:0000000000000007: returned tid unexpected: 0285cbacc06d3a4c  ; want: 0285cbacc06d3a4c
	    xtesting.go:297: load 0285cbacc06d3a4c:0000000000000007: returned buf != nil
	    xtesting.go:297: load 0285cbad858bf2e6:0000000000000006: returned err unexpected:
	        have: <nil>
	        want: neo://1@127.0.0.1:27145: load 0285cbad858bf2e6:0000000000000006: 0000000000000006: object was deleted @0285cbad858bf2e6
	    xtesting.go:297: load 0285cbad858bf2e6:0000000000000006: returned tid unexpected: 0285cbad858bf2e6  ; want: 0285cbad858bf2e6
	    xtesting.go:297: load 0285cbad858bf2e6:0000000000000006: returned buf != nil
	    xtesting.go:315: load 7fffffffffffffff:0000000000000006: returned err unexpected:
	        have: <nil>
	        want: neo://1@127.0.0.1:27145: load 7fffffffffffffff:0000000000000006: 0000000000000006: object was deleted @0285cbad858bf2e6
	    xtesting.go:315: load 7fffffffffffffff:0000000000000006: returned tid unexpected: 0285cbad858bf2e6  ; want: 0285cbad858bf2e6
	    xtesting.go:315: load 7fffffffffffffff:0000000000000006: returned buf != nil
	    xtesting.go:315: load 7fffffffffffffff:0000000000000007: returned err unexpected:
	        have: <nil>
	        want: neo://1@127.0.0.1:27145: load 7fffffffffffffff:0000000000000007: 0000000000000007: object was deleted @0285cbacc06d3a4c
	    xtesting.go:315: load 7fffffffffffffff:0000000000000007: returned tid unexpected: 0285cbacc06d3a4c  ; want: 0285cbacc06d3a4c
	    xtesting.go:315: load 7fffffffffffffff:0000000000000007: returned buf != nil
parent bc2cddfc
...@@ -480,6 +480,13 @@ func (c *Client) Load(ctx context.Context, xid zodb.Xid) (buf *mem.Buf, serial z ...@@ -480,6 +480,13 @@ func (c *Client) Load(ctx context.Context, xid zodb.Xid) (buf *mem.Buf, serial z
buf = buf2 buf = buf2
} }
// deletion is returned as empty data
// https://lab.nexedi.com/nexedi/neoppod/blob/c1c26894/neo/client/app.py#L464-471
if len(buf.Data) == 0 {
buf.Release()
return nil, 0, &zodb.NoDataError{Oid: xid.Oid, DeletedAt: resp.Serial}
}
// reply.NextSerial // reply.NextSerial
// reply.DataSerial // reply.DataSerial
return buf, resp.Serial, nil return buf, resp.Serial, nil
......
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