{"push_id":2013621807,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"3ca0512eab1d4ad819116fb0a7e75a222755e7b2","before":"7a1987cd1eaf0fccdeb682ef060ad92deb6b6829","commits":[{"sha":"3ca0512eab1d4ad819116fb0a7e75a222755e7b2","author":{"name":"Narayanan Iyer","email":"24385f4e280e47ffb5f43060aaea182d689c241a@yottadb.com"},"message":"[YDB#30] [NARS] [estess] Fix SIG-11 from source server if started with an external filter followed by a deactivate and shutdown\n\nRelease Note\n-------------\nThe replication source server terminates normally in case it was started with an external filter and later\ntransitioned from an active to a passive source server before being asked to shut down. Previously, the source\nserver would terminate abnormally with a SIG-11. (YDB#30)\n\nTest\n-----\n* New r110/srcsrv_extfilter_sig11 subtest fails reliably without the fixes and passes reliably with the fix.\n* E_ALL run many times to ensure no regressions.\n\nREADME\n-------\nWhen an active replication source server is deactivated, it changes mode from ACTIVE to PASSIVE mode. This also\ncauses it to close external filters (if it had them open) by a call to repl_stop_filter() (in gtmsource.c).\n\n    517                 if (gtmsource_filter & EXTERNAL_FILTER)\n    518                         repl_stop_filter();\n\nWhile it is in passive mode (and waiting to be activated again or asked to shutdown), if it encounters a shutdown\nsignal, it goes to gtmsource_end() which in turn ends up invoking replstop_filter(). But this function cannot be\ninvoked more than once.  That is because it sends a message to the other side of the filter (the receiver side)\nto stop and then closes the source side of the filter and frees up and nullifies the associated buffers (including\nthe global variable \"extract_buff\"). The second invocation of this function ends up with a SIG-11 when trying to\nsend a message to the other side because \"extract_buff\" is NULL. Below is the stack trace.\n\n(gdb) where\n #0  0x000000000082200a in rel_lock (reg=0x3044958) at /Distrib/GT.M/V63002/sr_unix/rel_lock.c:85\n #1  0x0000000000474602 in gtmsource_end1 (auto_shutdown=1) at /Distrib/GT.M/V63002/sr_unix/gtmsource_end.c:80\n #2  0x000000000049d514 in gtmsource_stop (exit=0) at /Distrib/GT.M/V63002/sr_unix/gtmsource_shutdown.c:323\n #3  0x000000000049d55b in gtmsource_sigstop () at /Distrib/GT.M/V63002/sr_unix/gtmsource_shutdown.c:333\n #4  0x00000000006d5377 in generic_signal_handler (sig=11, info=0x7ffd3122d6b0, context=0x7ffd3122d580)\n    at /Distrib/GT.M/V63002/sr_unix/generic_signal_handler.c:374\n #5  <signal handler called>\n #6  0x000000000057b776 in repl_filter_send (tr_num=0, tr=0x0, tr_len=0, first_send=1)\n    at /Distrib/GT.M/V63002/sr_port/repl_filter.c:660\n #7  0x0000000000581342 in repl_stop_filter () at /Distrib/GT.M/V63002/sr_port/repl_filter.c:1128\n #8  0x000000000047504f in gtmsource_end1 (auto_shutdown=0) at /Distrib/GT.M/V63002/sr_unix/gtmsource_end.c:136\n #9  0x000000000047509e in gtmsource_end () at /Distrib/GT.M/V63002/sr_unix/gtmsource_end.c:148\n #10 0x000000000046d968 in gtmsource () at /Distrib/GT.M/V63002/sr_unix/gtmsource.c:520\n #11 0x000000000044a022 in main (argc=11, argv=0x7ffd3122e7d8) at /Distrib/GT.M/V63002/sr_unix/mupip.c:123\n\nThe fix is to turn off the EXTERNAL_FILTER bit in \"gtmsource_filter\" right after a call to repl_stop_filter().\nSince repl_stop_filter() is called from various places in the source server a macro STOP_EXTERNAL_FILTER_IF_NEEDED\nwas introduced to take care of this.\n\nAlthough the receiver server does not suffer from this exact issue, it also invokes repl_stop_filter() in various\nplaces and might have a similar issue. So all those callers too were fixed to use this new macro. But they\nmanipulate the global variable \"gtmrecv_filter\" (instead of \"gtmsource_filter\").","distinct":true,"url":"https://api.github.com/repos/nars1/YottaDB/commits/3ca0512eab1d4ad819116fb0a7e75a222755e7b2"}]}
{"actor":{"display_login":"nars1"}}