-
Notifications
You must be signed in to change notification settings - Fork 178
Cherry pick ic commits from gp7 #1351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
zhangyue1818
wants to merge
7
commits into
apache:main
Choose a base branch
from
zhangyue1818:cherry-pick-ic
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+448
−388
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, @zhangyue1818 welcome!🎊 Thanks for taking the effort to make our project better! 🙌 Keep making such awesome contributions!
10a0611
to
ae89fd0
Compare
ae89fd0
to
29bcd9b
Compare
This patch aims to fix the memory leak issue #10314 . Previously, the IC history table got pruned only after begining a new distributed transaction (dtx). As a result, when a transaction contains many commands, or when a session never begins any distributed transaction, the history will never get pruned. This can cause memory leak. This patch fixes this issue by reverting this part of code to the last version before dependency on distributed transaction was introduced. After that, we will only a constant-length IC history. This ensures that - The history table takes only constant amount of memory, and - The history is long enough to handle mismatched packets.
This modernizes and refactors the UDP IC socket setup code somewhat, drawing inspiration from pgstat_init(), where similar UDP socket setup is performed. Significant changes: * Prefer pg_getaddrinfo_all() to getaddrinfo(). * Consistently use guarded logging for address retries. * Simplify interface for sizing UDP IC socket send/receive buffers.
…ion (#16458) Previous PR #13355 fixed issue #10314. But it introduced a new bug: IC-UDP may hang forever in some scenarios (e.g. lots of IC instances in single one UDF), please see the discussion in #13411. Enhancing it in this PR: * for the non-read-only transaction, keep the previous logic (before PR-13355) to prevent the new bug. * for the read-only transaction, introduce gp_interconnect_cursor_ic_table_size to config the size of Cursor History Table as a workaround.
`SendDummyPacket` eventually calls `getaddrinfo` (which is a reentrant), however, `getaddrinfo` is not an async-signal-safe function. `getaddrinfo` internally calls `malloc`, which is strongly advised to not do within a signal handler as it may cause deadlocks. Cache the accepted socket information for the listener, so that it can be reused in `SendDummyPacket()`. The purpose of `SendDummyPacket` is to exit more quickly; it circumvents the polling that happens, which eventually times out after 250ms. Without `SendDummyPacket()`, there will be multiple test failures since some tests expects the backend connection to terminate almost immediately. To view all the async-signal-safe functions, please view the signal-safety(7) — Linux manual page. Reviewed-by: Soumyadeep Chakraborty <soumyadeep2007@gmail.com> Reviewed-by: Andrew Repp <reppa@vmware.com>
Previously on commit 70306db18e2, we removed pg_getaddrinfo_all for signal handlers. However, in doing so, the capability of supporting both AF_INET6 and AF_INET was lost; this responsibility must now be handled by us. The commit mentioned above fixed the issue for AF_INET (IPv4), but not for AF_INET6 (IPv6). This commit addresses the situation for both AF_INET and AF_INET6. Reviewed-by: Soumyadeep Chakraborty <soumyadeep2007@gmail.com>
`sendControlMessage()` method has no retry attempts, this refactor abstracted a `sendto` system call wrapper with retry enabled. Co-authored-by: zwenlin <zwenlin@vmware.com>
…nd packet" (#17164) * Add hint message for MTU settings when IC reports ERROR "Failed to send packet".
29bcd9b
to
22c2bf4
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #ISSUE_Number
What does this PR do?
Type of Change
Breaking Changes
Test Plan
make installcheck
make -C src/test installcheck-cbdb-parallel
Impact
Performance:
User-facing changes:
Dependencies:
Checklist
Additional Context
CI Skip Instructions