Re: [I] [BUG] admin can't delete upstream success [shenyu]</span></a></span> </h1> <p class="darkgray font13"> <span class="sender pipe"><a href="/search?l=notifications@shenyu.apache.org&q=from:%22via+GitHub%22" rel="nofollow"><span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">via GitHub</span></span></a></span> <span class="date"><a href="/search?l=notifications@shenyu.apache.org&q=date:20260922" rel="nofollow">Tue, 22 Sep 2026 01:05:24 -0700</a></span> </p> </div> <div itemprop="articleBody" class="msgBody"> <!--X-Body-of-Message--> <pre> ywj1352 commented on issue #7165: URL: <a rel="nofollow" href="https://github.com/apache/shenyu/issues/7165#issuecomment-5773069562">https://github.com/apache/shenyu/issues/7165#issuecomment-5773069562</a></pre><pre> # I. Logic Summary (The Complete Truth of This Sync Chain) **Core mechanism:** discovery upstream synchronization follows a "full-snapshot UPDATE" model — after each change, the admin side reads out the entire remaining upstream group via `fetchAll`, publishes a `DISCOVER_UPSTREAM / UPDATE` event, and the gateway's `onSubscribe → submit()` replaces the whole group. Deletion = absence from the new list; an empty list automatically clears the cache. ## Actual status of each deletion scenario | Scenario | Chain | Status | |---|---|---| | External instance offline | `DiscoveryDataChangedEventSyncListener`: deletes DB rows, then unconditionally publishes the remaining snapshot | ✓ Working | | Client registration offline | `offline() → fetch() → UPDATE` | ✓ Working | | Health-check removal | `UpstreamCheckService → UPDATE filtered snapshot` | ✓ Working | | Selector deletion | SELECTOR-group DELETE fallback → `removeByKey` | ✓ Working (via fallback) | | Manual single-upstream deletion (console) | `delete()` only deletes DB rows, publishes no event | ✗ The only real bug, since 2023 | | Rebind / delete selector-level discovery | DELETE event swallowed by empty `unSubscribe`; zk channel lacks the DELETE branch entirely | ✗ Defensive gap | **Final verdict on the empty `unSubscribe`:** it is a contract method copied from the subscriber-family template. Its only real traffic comes from `removeSelectorUpstream` — which is in turn masked by the fallback. Zero actual damage in three years: it is a "never-truly-used contract", not the scene of an incident. # II. Fix Recommendation (Step 1 already implemented and compiling clean) - **Step 1 (do now):** fix `DiscoveryUpstreamServiceImpl.delete` to publish the remaining-list snapshot after deletion, symmetric with create/update — collect the affected `discoveryHandlerId`s *before* deleting (they cannot be queried afterwards), delete the rows, then call `fetchAll` once per group. Zero interface changes, all nine sync channels covered for free, +7 lines in one file. - **Step 2 (follow-up, not urgent):** complete the DELETE consumer chain — add a `default` remove hook to `DiscoveryUpstreamDataHandler`, implement it per plugin (divide/websocket → `removeByKey`, grpc → `ApplicationConfigCache.invalidate`, tcp → `refreshCache` with an empty list), route `unSubscribe` to it, and add the missing DELETE branch to `discoveryUpstreamHandlerEvent` for the zk/etcd/consul path. Defensive hardening — wait for upstream feedback or a real-world report of the rebind scenario. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@shenyu.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org </pre> </div> <div class="msgButtons margintopdouble"> <ul class="overflow"> <li class="msgButtonItems"><a class="button buttonleft " accesskey="p" href="msg37808.html">Previous message</a></li> <li class="msgButtonItems textaligncenter"><a class="button" accesskey="c" href="thrd5.html#37815">View by thread</a></li> <li class="msgButtonItems textaligncenter"><a class="button" accesskey="i" href="mail6.html#37815">View by date</a></li> <li class="msgButtonItems textalignright"><a class="button buttonright " accesskey="n" href="msg37817.html">Next message</a></li> </ul> </div> <a name="tslice"></a> <div class="tSliceList margintopdouble"> <ul class="icons monospace"> <li class="icons-email"><span class="subject"><a href="msg37810.html">[I] [BUG] <title> admin cont't delete upstream success [s...</a></span> <span class="sender italic">via GitHub</span></li> <li><ul> <li class="icons-email"><span class="subject"><a href="msg37808.html">Re: [I] [BUG] <title> admin cont't delete upstream s...</a></span> <span class="sender italic">via GitHub</span></li> <li class="icons-email tSliceCur"><span class="subject">Re: [I] [BUG] <title> admin can't delete upstream su...</span> <span class="sender italic">via GitHub</span></li> <li class="icons-email"><span class="subject"><a href="msg37817.html">Re: [I] [BUG] <title> admin cont't delete upstream s...</a></span> <span class="sender italic">via GitHub</span></li> </ul> </ul> </div> <div class="overflow msgActions margintopdouble"> <div class="msgReply" > <h2> Reply via email to </h2> <form method="POST" action="/mailto.php"> <input type="hidden" name="subject" value="Re: [I] [BUG] <title> admin can't delete upstream success [shenyu]"> <input type="hidden" name="msgid" value="I_kwDOCGCHjs8AAAABSfof4A-4463740d-264c-4d9f-957a-47235b0ffe3e@gitbox.apache.org"> <input type="hidden" name="relpath" value="notifications@shenyu.apache.org/msg37815.html"> <input type="submit" value=" via GitHub "> </form> </div> </div> </div> <div class="aside" role="complementary"> <div class="logo"> <a href="/"><img src="/logo.png" width=247 height=88 alt="The Mail Archive"></a> </div> <form class="overflow" action="/search" method="get"> <input type="hidden" name="l" value="notifications@shenyu.apache.org"> <label class="hidden" for="q">Search the site</label> <input class="submittext" type="text" id="q" name="q" placeholder="Search notifications"> <input class="submitbutton" name="submit" type="image" src="/submit.png" alt="Submit"> </form> <div class="nav margintop" id="nav" role="navigation"> <ul class="icons font16"> <li class="icons-home"><a href="/">The Mail Archive home</a></li> <li class="icons-list"><a href="/notifications@shenyu.apache.org/">notifications - all messages</a></li> <li class="icons-about"><a href="/notifications@shenyu.apache.org/info.html">notifications - about the list</a></li> <li class="icons-expand"><a href="/search?l=notifications@shenyu.apache.org&q=subject:%22Re%5C%3A+%5C%5BI%5C%5D+%5C%5BBUG%5C%5D+%3Ctitle%3E+admin+can%27t+delete+upstream+success+%5C%5Bshenyu%5C%5D%22&o=newest&f=1" title="e" id="e">Expand</a></li> <li class="icons-prev"><a href="msg37808.html" title="p">Previous message</a></li> <li class="icons-next"><a href="msg37817.html" title="n">Next message</a></li> </ul> </div> <div class="listlogo margintopdouble"> </div> <div class="margintopdouble"> </div> </div> </div> <div class="footer" role="contentinfo"> <ul> <li><a href="/">The Mail Archive home</a></li> <li><a href="/faq.html#newlist">Add your mailing list</a></li> <li><a href="/faq.html">FAQ</a></li> <li><a href="/faq.html#support">Support</a></li> <li><a href="/faq.html#privacy">Privacy</a></li> <li class="darkgray">I_kwDOCGCHjs8AAAABSfof4A-4463740d-264c-4d9f-957a-47235b0ffe3e@gitbox.apache.org</li> </ul> </div> </body> </html>