Refactor Extend Protocol in libpq for Binary Data Handling #1098
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.
This commit refines the existing implementation of the extend protocol in libpq, focusing on changes to data types and processing mechanisms. The main adjustments include a transition from generic data handling to a strict binary data format for improved efficiency and clarity in data transmission. This change ensures that the protocol explicitly handles binary data, enhancing performance during execution.
Before this commit
Extend protocol:
After this commit
Extend protocol:
Protocol processing between QD and QE:
Additionally, the process for receiving and managing binary data within the
ExtendProtocolData
structure has been streamlined. Each received message is now parsed into a structured format that includes subtags, allowing for more efficient data organization and retrieval.Memory management continues to utilize
TopTransactionContext
for storing binary data, ensuring optimal usage while simplifying cleanup during data consumption. Adjustments to theConsumeExtendProtocolData()
function reflect these changes, ensuring that binary data is efficiently marked as consumed and appropriately cleaned up.Overall, this refactor enhances the extend protocol's capability to manage binary data more effectively, improving the overall performance and reliability of data transmission between the QE and QD.
Authored-by: Zhang Mingli avamingli@gmail.com
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