This is an automated email from the ASF dual-hosted git repository. leborchuk pushed a commit to branch REL_2_STABLE in repository https://gitbox.apache.org/repos/asf/cloudberry.git
commit 5a72e1d776ff3a3273163b0f2a2ffbafff1c817d Author: ZTE-EBASE <[email protected]> AuthorDate: Mon Sep 28 14:04:23 2026 +0800 Fix putIntoUnackQueueRing function logic for Intercontect interfaces:loss advance method Co-authored-by: 王平10304955 <[email protected]> --- contrib/interconnect/udp/ic_udpifc.c | 14 +++++++------- contrib/udp2/ic_common/udp2/ic_udp2.cpp | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/contrib/interconnect/udp/ic_udpifc.c b/contrib/interconnect/udp/ic_udpifc.c index 47c6273470c..cf73535241c 100644 --- a/contrib/interconnect/udp/ic_udpifc.c +++ b/contrib/interconnect/udp/ic_udpifc.c @@ -7037,8 +7037,14 @@ putIntoUnackQueueRing(UnackQueueRing *uqr, ICBuffer *buf, uint64 expTime, uint64 } else if (diff < TIMER_SPAN_LOSS) { - diff = diff < TIMER_SPAN_LOSS ? TIMER_SPAN_LOSS : diff; + diff = TIMER_SPAN_LOSS; } + + idx = (uqr->idx + diff / TIMER_SPAN_LOSS) % UNACK_QUEUE_RING_SLOTS_NUM; + +#ifdef AMS_VERBOSE_LOGGING + write_log("PUTTW: curtime " UINT64_FORMAT " now " UINT64_FORMAT " (diff " UINT64_FORMAT ") expTime " UINT64_FORMAT " previdx %d, nowidx %d, nextidx %d", uqr->currentTime, now, diff, expTime, buf->unackQueueRingSlot, uqr->idx, idx); +#endif } else { @@ -7065,12 +7071,6 @@ putIntoUnackQueueRing(UnackQueueRing *uqr, ICBuffer *buf, uint64 expTime, uint64 #endif } - idx = (uqr->idx + diff / TIMER_SPAN) % UNACK_QUEUE_RING_SLOTS_NUM; - -#ifdef AMS_VERBOSE_LOGGING - write_log("PUTTW: curtime " UINT64_FORMAT " now " UINT64_FORMAT " (diff " UINT64_FORMAT ") expTime " UINT64_FORMAT " previdx %d, nowidx %d, nextidx %d", uqr->currentTime, now, diff, expTime, buf->unackQueueRingSlot, uqr->idx, idx); -#endif - buf->unackQueueRingSlot = idx; icBufferListAppend(&unack_queue_ring.slots[idx], buf); } diff --git a/contrib/udp2/ic_common/udp2/ic_udp2.cpp b/contrib/udp2/ic_common/udp2/ic_udp2.cpp index a747d91f600..f416a46d62b 100644 --- a/contrib/udp2/ic_common/udp2/ic_udp2.cpp +++ b/contrib/udp2/ic_common/udp2/ic_udp2.cpp @@ -3049,8 +3049,14 @@ putIntoUnackQueueRing(UnackQueueRing *uqr, ICBuffer *buf, uint64 expTime, uint64 } else if (diff < TIMER_SPAN_LOSS) { - diff = diff < TIMER_SPAN_LOSS ? TIMER_SPAN_LOSS : diff; + diff = TIMER_SPAN_LOSS; } + + idx = (uqr->idx + diff / TIMER_SPAN_LOSS) % UNACK_QUEUE_RING_SLOTS_NUM; + +#ifdef AMS_VERBOSE_LOGGING + LOG(INFO, "PUTTW: curtime %lu now %lu (diff %lu) expTime %lu previdx %d, nowidx %d, nextidx %d", uqr->currentTime, now, diff, expTime, buf->unackQueueRingSlot, uqr->idx, idx); +#endif } else { @@ -3077,12 +3083,6 @@ putIntoUnackQueueRing(UnackQueueRing *uqr, ICBuffer *buf, uint64 expTime, uint64 #endif } - idx = (uqr->idx + diff / TIMER_SPAN) % UNACK_QUEUE_RING_SLOTS_NUM; - -#ifdef AMS_VERBOSE_LOGGING - LOG(INFO, "PUTTW: curtime %lu now %lu (diff %lu) expTime %lu previdx %d, nowidx %d, nextidx %d", uqr->currentTime, now, diff, expTime, buf->unackQueueRingSlot, uqr->idx, idx); -#endif - buf->unackQueueRingSlot = idx; unack_queue_ring.slots[idx].append(buf); } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
