diff --git a/src/box/recovery.cc b/src/box/recovery.cc index 6600e8b4eb0aec10c3be42bc7dcda80d6985eb76..6b8f6a51aa05c27cda5872f415ece8aaefc02fe0 100644 --- a/src/box/recovery.cc +++ b/src/box/recovery.cc @@ -979,7 +979,6 @@ wal_write(struct recovery_state *r, struct xrow_header *row) req->res = -1; req->row = row; row->tm = ev_now(loop()); - row->sync = 0; (void) tt_pthread_mutex_lock(&writer->mutex); diff --git a/src/box/xrow.cc b/src/box/xrow.cc index cea768767d8d538ad871eefae5013d73fa62cded..4200bbb69888a9a4c8682616419809250616009e 100644 --- a/src/box/xrow.cc +++ b/src/box/xrow.cc @@ -118,13 +118,14 @@ xrow_header_encode(const struct xrow_header *header, struct iovec *out) d = mp_encode_uint(d, header->type); map_size++; } - +/* https://github.com/tarantool/tarantool/issues/881 */ +#if 0 if (header->sync) { d = mp_encode_uint(d, IPROTO_SYNC); d = mp_encode_uint(d, header->sync); map_size++; } - +#endif if (header->server_id) { d = mp_encode_uint(d, IPROTO_SERVER_ID); d = mp_encode_uint(d, header->server_id); diff --git a/test/box/errinj.result b/test/box/errinj.result index a909c3f5005ac43490085107ba6c03eb80bf2317..1a12647ca3a30871d8025094bc219a6c6b7d9948 100644 --- a/test/box/errinj.result +++ b/test/box/errinj.result @@ -1,6 +1,9 @@ errinj = box.error.injection --- ... +net_box = require('net.box') +--- +... space = box.schema.space.create('tweedledum') --- ... @@ -395,9 +398,45 @@ errinj.set("ERRINJ_TUPLE_ALLOC", false) --- - ok ... +-- gh-881 iproto request with wal IO error +box.schema.user.grant('guest', 'read,write,execute', 'universe') +--- +... +test = box.schema.create_space('test') +--- +... +_ = test:create_index('primary') +--- +... +for i=1, box.cfg.rows_per_wal do test:insert{i, 'test'} end +--- +... +c = net_box:new(box.cfg.listen) +--- +... +-- try to write xlog without permission to write to disk +errinj.set('ERRINJ_WAL_WRITE', true) +--- +- ok +... +c.space.test:insert({box.cfg.rows_per_wal + 1,1,2,3}) +--- +- error: Failed to write to disk +... +errinj.set('ERRINJ_WAL_WRITE', false) +--- +- ok +... +-- Cleanup s:drop() --- ... +test:drop() +--- +... errinj = nil --- ... +box.schema.user.revoke('guest', 'read,write,execute', 'universe') +--- +... diff --git a/test/box/errinj.test.lua b/test/box/errinj.test.lua index 711ffdd1f752277084e6e254a9bfee4da1a8ec9b..1a61e01ee2d3a9c09f9935a18db191a08e09e872 100644 --- a/test/box/errinj.test.lua +++ b/test/box/errinj.test.lua @@ -1,4 +1,5 @@ errinj = box.error.injection +net_box = require('net.box') space = box.schema.space.create('tweedledum') index = space:create_index('primary', { type = 'hash' }) @@ -128,7 +129,21 @@ s:select{}; --# setopt delimiter '' errinj.set("ERRINJ_TUPLE_ALLOC", false) -s:drop() +-- gh-881 iproto request with wal IO error +box.schema.user.grant('guest', 'read,write,execute', 'universe') +test = box.schema.create_space('test') +_ = test:create_index('primary') + +for i=1, box.cfg.rows_per_wal do test:insert{i, 'test'} end +c = net_box:new(box.cfg.listen) +-- try to write xlog without permission to write to disk +errinj.set('ERRINJ_WAL_WRITE', true) +c.space.test:insert({box.cfg.rows_per_wal + 1,1,2,3}) +errinj.set('ERRINJ_WAL_WRITE', false) +-- Cleanup +s:drop() +test:drop() errinj = nil +box.schema.user.revoke('guest', 'read,write,execute', 'universe')