<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 30, 2019 at 7:35 AM Li, Deqian (NSB - CN/Hangzhou) <<a href="mailto:deqian.li@nokia-sbell.com">deqian.li@nokia-sbell.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div lang="ZH-CN">
<div class="gmail-m_4409226495003423842WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hi,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Could you help to check this coredump?<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">We are using glusterfs 3.12-3(3 replicated bricks solution ) to do stability testing under high CPU load like 80% by stress and doing I/O.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">After several hours, coredump happened in glusterfs side .<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">[Current thread is 1 (Thread 0x7ffff37d2700 (LWP 3696))]<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Missing separate debuginfos, use: dnf debuginfo-install rcp-pack-glusterfs-1.8.1_11_g99e9ca6-RCP2.wf28.x86_64<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">(gdb) bt<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">#0 0x00007ffff0d5c845 in wb_fulfill (wb_inode=0x7fffd406b3b0, liabilities=0x7fffdc234b50) at write-behind.c:1148<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">#1 0x00007ffff0d5e4d5 in wb_process_queue (wb_inode=0x7fffd406b3b0) at write-behind.c:1718<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">#2 0x00007ffff0d5eda7 in wb_writev (frame=0x7fffe0086290, this=0x7fffec014b00, fd=0x7fffe4034070, vector=0x7fffdc445720, count=1, offset=67108863, flags=32770, iobref=0x7fffdc00d550, xdata=0x0)<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> at write-behind.c:1825<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">#3 0x00007ffff0b51fcb in du_writev_resume (ret=0, frame=0x7fffdc0305a0, opaque=0x7fffdc0305a0) at disk-usage.c:490<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">#4 0x00007ffff7b3510d in synctask_wrap () at syncop.c:377<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">#5 0x00007ffff60d0660 in ?? () from /lib64/libc.so.6<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">#6 0x0000000000000000 in ?? ()<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">(gdb) p wb_inode<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">$1 = (wb_inode_t *) 0x7fffd406b3b0<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">(gdb) frame 2<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">#2 0x00007ffff0d5eda7 in wb_writev (frame=0x7fffe0086290, this=0x7fffec014b00, fd=0x7fffe4034070, vector=0x7fffdc445720, count=1, offset=67108863, flags=32770, iobref=0x7fffdc00d550, xdata=0x0)<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> at write-behind.c:1825<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">1825 in write-behind.c<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">(gdb) p *fd<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">$2 = {pid = 18154, flags = 32962, <span style="color:red">
refcount = 0,</span> inode_list = {next = 0x7fffe4034080, prev = 0x7fffe4034080}, inode = 0x0, lock = {spinlock = 0, mutex = {__data = {__lock = 0, __count = 0, __owner = 0,
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> __nusers = 0, __kind = -1, __spins = 0, __elision = 0, __list = {__prev = 0x0, __next = 0x0}}, __size = '\000' <repeats 16 times>, "\377\377\377\377", '\000' <repeats 19 times>, __align = 0}},
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> _ctx = 0x7fffe4022930, xl_count = 17, lk_ctx = 0x7fffe40350e0, anonymous = _gf_false}<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">(gdb) p fd<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">$3 = (fd_t *) 0x7fffe4034070<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">(gdb) p wb_inode->this<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">$1 = (xlator_t *) 0xffffffffffffff00<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">After adding test log I found the FOP sequence in write-behind xlator side was mass as bellow showing. In the FUSE side the FLUSH is after write2, but in the WB side, FLUSH is between write2 ‘wb_do_unwinds’ and ‘wb_fulfill’.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">So I think this should has problem. </span></p></div></div></blockquote><div><br></div><div>wb_do_unwinds the write after caching it. Once the write response is unwound, kernel issues a FLUSH. So, this is a valid sequence of operations and nothing wrong.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="ZH-CN"><div class="gmail-m_4409226495003423842WordSection1"><p class="MsoNormal"><span lang="EN-US">I think it’s possible that the FLUSH and later RELEASE operation will destroy the fd , it will cause ‘wb_in->this(0xffffffffffffff00)’. Do you think so?<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">And I think our new adding disk-usage xlator’s synctask_new will dealy the write operation, but the FLUSH operation without this delay(because not invoked the disk-usage xlator).</span></p></div></div></blockquote><div><br></div><div>Flush and release wait for completion of any on-going writes. So, unless write-behind has unwound the write, it won't see a flush. By the time write is unwound, write-behind makes sure to take references on objects it uses (like fds, iobref etc). So, I don't see a problem there.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="ZH-CN"><div class="gmail-m_4409226495003423842WordSection1"><p class="MsoNormal"><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Do you agree with my speculation ? and how to fix?(we don’t want to move the disk-usage xlator)</span></p></div></div></blockquote><div><br></div><div>I've still not found the RCA. We can discuss about the fix once RCA is found.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="ZH-CN"><div class="gmail-m_4409226495003423842WordSection1"><p class="MsoNormal"><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Problematic FOP sequence :<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">FUSE side: WB side:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> <u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Write 1 write1<u></u><u></u></span></p>
<p class="MsoNormal" style="text-indent:115.5pt"><span lang="EN-US">Write2 do unwind<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Write 2 FLUSH<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> Release(destroy fd)<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">FLUSH <span style="color:red">
write2</span> (wb_fulfill) then coredump.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Release<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">int<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">wb_fulfill (wb_inode_t *wb_inode, list_head_t *liabilities)<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">{<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> wb_request_t *req = NULL;<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> wb_request_t *head = NULL;<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> wb_request_t *tmp = NULL;<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> wb_conf_t *conf = NULL;<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> off_t expected_offset = 0;<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> size_t curr_aggregate = 0;<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> size_t vector_count = 0;<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> int ret = 0;<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> <span style="color:red">conf = wb_inode->this->private;
</span></span><span style="font-family:Wingdings;color:red" lang="EN-US">à</span><span style="color:red" lang="EN-US"> this line coredump</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> list_for_each_entry_safe (req, tmp, liabilities, winds) {<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> list_del_init (&req->winds);<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">….<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">volume ccs-write-behind<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">68: type performance/write-behind<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">69: subvolumes ccs-dht<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">70: end-volume<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">71: <u></u><u></u></span></p>
<p class="MsoNormal"><b><span lang="EN-US"> 72: volume ccs-disk-usage
</span></b><b><span style="font-family:Wingdings" lang="EN-US">à</span><span lang="EN-US"> we add a new xlator here for write op ,just for checking if disk if full. And synctask_new for write.<u></u><u></u></span></b></p>
<p class="MsoNormal"><b><span lang="EN-US">73: type performance/disk-usage<u></u><u></u></span></b></p>
<p class="MsoNormal"><b><span lang="EN-US">74: subvolumes ccs-write-behind<u></u><u></u></span></b></p>
<p class="MsoNormal"><b><span lang="EN-US">75: end-volume<u></u><u></u></span></b></p>
<p class="MsoNormal"><span lang="EN-US">76: <u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> 77: volume ccs-read-ahead<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">78: type performance/read-ahead<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">79: subvolumes ccs-disk-usage<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">80: end-volume<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Ps. Part of Our new translator code<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">int<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">du_writev (call_frame_t *frame, xlator_t *this, fd_t *fd,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> struct iovec *vector, int count, off_t off, uint32_t flags,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> struct iobref *iobref, dict_t *xdata)<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">{<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> int op_errno = -1;<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> int ret = -1;<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> du_local_t *local = NULL;<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> loc_t tmp_loc = {0,};<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> VALIDATE_OR_GOTO (frame, err);<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> VALIDATE_OR_GOTO (this, err);<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> VALIDATE_OR_GOTO (fd, err);<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> tmp_loc.gfid[15] = 1;<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> tmp_loc.inode = fd->inode;<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> tmp_loc.parent = fd->inode;<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> local = du_local_init (frame, &tmp_loc, fd, GF_FOP_WRITE);<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> if (!local) {<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> op_errno = ENOMEM;<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> goto err;<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> }<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> local->vector = iov_dup (vector, count);<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> local->offset = off;<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> local->count = count;<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> local->flags = flags;<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> local->iobref = iobref_ref (iobref);<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> <u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> ret = <span style="color:red">synctask_new(</span>this->ctx->env, du_get_du_info,du_writev_resume,frame,frame);<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> if(ret)<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> {<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> op_errno = -1;<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> gf_log (this->name, GF_LOG_WARNING,"synctask_new return failure ret(%d) ",ret);<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> goto err;<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> }<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> return 0;<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">err:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> op_errno = (op_errno == -1) ? errno : op_errno;<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> DU_STACK_UNWIND (writev, frame, -1, op_errno, NULL, NULL, NULL);<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> return 0;<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">}<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Br,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Li Deqian<u></u><u></u></span></p>
</div>
</div>
</blockquote></div></div>