Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6f4bdf8

Browse files
author
Amit Kapila
committed
Fix assertion during streaming of multi-insert toast changes.
While decoding the multi-insert WAL we can't clean the toast untill we getthe last insert of that WAL record. Now if we stream the changes before weget the last change, the memory for toast chunks won't be released and weexpect the txn to have streamed all changes after streaming. Thisrestriction is mainly to ensure the correctness of streamed transactionsand it doesn't seem worth uplifting such a restriction just to allow thiscase because anyway we will stream the transaction once such an insert iscomplete.Previously we were using two different flags (one for toast tuples andanother for speculative inserts) to indicate partial changes. Now insteadwe replaced both of them with a single flag to indicate partial changes.Reported-by: Pavan DeolaseeAuthor: Dilip KumarReviewed-by: Pavan Deolasee, Amit KapilaDiscussion:https://postgr.es/m/CABOikdN-_858zojYN-2tNcHiVTw-nhxPwoQS4quExeweQfG1Ug@mail.gmail.com
1 parent190fa5a commit6f4bdf8

File tree

4 files changed

+73
-42
lines changed

4 files changed

+73
-42
lines changed

‎contrib/test_decoding/expected/stream.out‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,30 @@ SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL,NULL, 'incl
8282
committing streamed transaction
8383
(13 rows)
8484

85+
-- streaming test for toast with multi-insert
86+
\COPY stream_test FROM STDIN
87+
SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL,NULL, 'include-xids', '0', 'skip-empty-xacts', '1', 'stream-changes', '1');
88+
data
89+
------------------------------------------
90+
opening a streamed block for transaction
91+
streaming change for transaction
92+
streaming change for transaction
93+
streaming change for transaction
94+
streaming change for transaction
95+
streaming change for transaction
96+
streaming change for transaction
97+
streaming change for transaction
98+
streaming change for transaction
99+
streaming change for transaction
100+
streaming change for transaction
101+
streaming change for transaction
102+
closing a streamed block for transaction
103+
opening a streamed block for transaction
104+
streaming change for transaction
105+
closing a streamed block for transaction
106+
committing streamed transaction
107+
(17 rows)
108+
85109
DROP TABLE stream_test;
86110
SELECT pg_drop_replication_slot('regression_slot');
87111
pg_drop_replication_slot

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp