You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{"payload":{"commit":{"oid":"ec86af917551f52246848dd148885df034273f3d","url":"/postgres/postgres/commit/ec86af917551f52246848dd148885df034273f3d","authoredDate":"2017-07-05T23:59:20.000-04:00","committedDate":"2017-07-05T23:59:20.000-04:00","shortMessage":null,"shortMessageMarkdown":"\u003cdiv\u003eFix another race-condition-ish issue in recovery/t/001_stream_rep.pl.\u003c/div\u003e","shortMessageMarkdownLink":null,"bodyMessageHtml":"Buildfarm members hornet and sungazer have shown multiple instances of\n\"Failed test 'xmin of non-cascaded slot with hs feedback has changed'\".\nThe reason seems to be that the test is checking the current xmin of the\nmaster server's replication slot against a past xmin of the first slave\nserver's replication slot. Even though the latter slot is downstream of\nthe former, it's possible for its reported xmin to be ahead of the former's\nreported xmin, because those numbers are updated whenever the respective\ndownstream walreceiver feels like it (see logic in WalReceiverMain).\nInstrumenting this test shows that indeed the slave slot's xmin does often\nadvance before the master's does, especially if an autovacuum transaction\nmanages to occur during the relevant window. If we happen to capture such\nan advanced xmin as $xmin, then the subsequent wait_slot_xmins call can\nfall through before the master's xmin has advanced at all, and then if it\nadvances before the get_slot_xmins call, we can get the observed failure.\nYeah, that's a bit of a long chain of deduction, but it's hard to explain\nany other way how the test can get past an \"xmin \u0026lt;\u0026gt; '$xmin'\" check only\nto have the next query find that xmin does equal $xmin.\n\nFix by keeping separate images of the master and slave slots' xmins\nand testing their has-xmin-advanced conditions independently.","authors":[{"login":"tglsfdc","displayName":"Tom Lane","avatarUrl":"https://avatars.githubusercontent.com/u/8755309?v=4","path":"/tglsfdc","isGitHub":false}],"committerAttribution":false,"committer":{"login":"tglsfdc","displayName":"Tom Lane","avatarUrl":"https://avatars.githubusercontent.com/u/8755309?v=4","path":"/tglsfdc","isGitHub":false},"parents":["ff68e909acd924b532e58c7699e93a1aff71654a"],"globalRelayId":"MDY6Q29tbWl0OTI3NDQyOmVjODZhZjkxNzU1MWY1MjI0Njg0OGRkMTQ4ODg1ZGYwMzQyNzNmM2Q=","sha1":"ff68e909acd924b532e58c7699e93a1aff71654a","sha2":"ec86af917551f52246848dd148885df034273f3d"},"currentUser":null,"repo":{"id":927442,"defaultBranch":"master","name":"postgres","ownerLogin":"postgres","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2010-09-21T11:35:45.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/177543?v=4","public":true,"private":false,"isOrgOwned":true},"diffEntryData":[{"diffLines":[{"stylingDirective":null,"type":"HUNK","blobLineNumber":219,"text":"@@ -220,9 +220,9 @@ sub replay_check","html":"@@ -220,9 +220,9 @@ sub replay_check","displayNoNewLineWarning":false,"position":0,"left":219,"right":219},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":220,"text":" is($catalog_xmin, '',","html":" is(\u003cspan class=\"pl-smi\"\u003e$catalog_xmin\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e,","displayNoNewLineWarning":false,"position":1,"left":220,"right":220},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":221,"text":" \t'catalog xmin of non-cascaded slot still null with hs_feedback');","html":" \t\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003ecatalog xmin of non-cascaded slot still null with hs_feedback\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e);","displayNoNewLineWarning":false,"position":2,"left":221,"right":221},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":222,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":3,"left":222,"right":222},{"stylingDirective":null,"type":"DELETION","blobLineNumber":223,"text":"-($xmin, $catalog_xmin) = get_slot_xmins($node_standby_1, $slotname_2);","html":"-\u003cspan class=\"x x-first\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-smi x x-last\"\u003e$xmin\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003e$\u003cspan class=\"x x-first x-last\"\u003ecatalog_xmin\u003c/span\u003e\u003c/span\u003e) = get_slot_xmins(\u003cspan class=\"pl-smi\"\u003e$node_standby_1\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003e$slotname_2\u003c/span\u003e);","displayNoNewLineWarning":false,"position":4,"left":223,"right":222},{"stylingDirective":null,"type":"DELETION","blobLineNumber":224,"text":"-isnt($xmin, '', 'xmin of cascaded slot non-null with hs feedback');","html":"-isnt(\u003cspan class=\"pl-smi\"\u003e$\u003cspan class=\"x x-first x-last\"\u003exmin\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003exmin of cascaded slot non-null with hs feedback\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003c/span\u003e);","displayNoNewLineWarning":false,"position":5,"left":224,"right":222},{"stylingDirective":null,"type":"DELETION","blobLineNumber":225,"text":"-is($catalog_xmin, '', 'catalog xmin of cascaded slot still null with hs_feedback');","html":"-is(\u003cspan class=\"pl-smi\"\u003e$\u003cspan class=\"x x-first x-last\"\u003ecatalog_xmin\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003ecatalog xmin of cascaded slot still null with hs_feedback\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003c/span\u003e);","displayNoNewLineWarning":false,"position":6,"left":225,"right":222},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":223,"text":"+my ($xmin1, $catalog_xmin1) = get_slot_xmins($node_standby_1, $slotname_2);","html":"+\u003cspan class=\"pl-k x x-first\"\u003emy\u003c/span\u003e\u003cspan class=\"x\"\u003e (\u003c/span\u003e\u003cspan class=\"pl-smi x x-last\"\u003e$xmin1\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003e$\u003cspan class=\"x x-first x-last\"\u003ecatalog_xmin1\u003c/span\u003e\u003c/span\u003e) = get_slot_xmins(\u003cspan class=\"pl-smi\"\u003e$node_standby_1\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003e$slotname_2\u003c/span\u003e);","displayNoNewLineWarning":false,"position":7,"left":225,"right":223},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":224,"text":"+isnt($xmin1, '', 'xmin of cascaded slot non-null with hs feedback');","html":"+isnt(\u003cspan class=\"pl-smi\"\u003e$\u003cspan class=\"x x-first x-last\"\u003exmin1\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003exmin of cascaded slot non-null with hs feedback\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003c/span\u003e);","displayNoNewLineWarning":false,"position":8,"left":225,"right":224},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":225,"text":"+is($catalog_xmin1, '', 'catalog xmin of cascaded slot still null with hs_feedback');","html":"+is(\u003cspan class=\"pl-smi\"\u003e$\u003cspan class=\"x x-first x-last\"\u003ecatalog_xmin1\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003ecatalog xmin of cascaded slot still null with hs_feedback\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003c/span\u003e);","displayNoNewLineWarning":false,"position":9,"left":225,"right":225},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":226,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":10,"left":226,"right":226},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":227,"text":" note \"doing some work to advance xmin\";","html":" note \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026quot;\u003c/span\u003edoing some work to advance xmin\u003cspan class=\"pl-pds\"\u003e\u0026quot;\u003c/span\u003e\u003c/span\u003e;","displayNoNewLineWarning":false,"position":11,"left":227,"right":227},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":228,"text":" $node_master-\u003esafe_psql('postgres', q{","html":" \u003cspan class=\"pl-smi\"\u003e$node_master\u003c/span\u003e\u003cspan class=\"pl-k\"\u003e-\u0026gt;\u003c/span\u003esafe_psql(\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003epostgres\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003eq{\u003c/span\u003e\u003c/span\u003e","displayNoNewLineWarning":false,"position":12,"left":228,"right":228},{"stylingDirective":null,"type":"HUNK","blobLineNumber":244,"text":"@@ -245,16 +245,16 @@ sub replay_check","html":"@@ -245,16 +245,16 @@ sub replay_check","displayNoNewLineWarning":false,"position":13,"left":244,"right":244},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":245,"text":" wait_slot_xmins($node_master, $slotname_1, \"xmin \u003c\u003e '$xmin'\");","html":" wait_slot_xmins(\u003cspan class=\"pl-smi\"\u003e$node_master\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003e$slotname_1\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026quot;\u003c/span\u003exmin \u0026lt;\u0026gt; \u0026#39;\u003cspan class=\"pl-smi\"\u003e$xmin\u003c/span\u003e\u0026#39;\u003cspan class=\"pl-pds\"\u003e\u0026quot;\u003c/span\u003e\u003c/span\u003e);","displayNoNewLineWarning":false,"position":14,"left":245,"right":245},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":246,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":15,"left":246,"right":246},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":247,"text":" my ($xmin2, $catalog_xmin2) = get_slot_xmins($node_master, $slotname_1);","html":" \u003cspan class=\"pl-k\"\u003emy\u003c/span\u003e (\u003cspan class=\"pl-smi\"\u003e$xmin2\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003e$catalog_xmin2\u003c/span\u003e) = get_slot_xmins(\u003cspan class=\"pl-smi\"\u003e$node_master\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003e$slotname_1\u003c/span\u003e);","displayNoNewLineWarning":false,"position":16,"left":247,"right":247},{"stylingDirective":null,"type":"DELETION","blobLineNumber":248,"text":"-note \"new xmin $xmin2, old xmin $xmin\";","html":"-note \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003enew xmin \u003cspan class=\"pl-smi\"\u003e$xmin2\u003c/span\u003e, old xmin \u003cspan class=\"pl-smi\"\u003e$xmin\u003c/span\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e;","displayNoNewLineWarning":false,"position":17,"left":248,"right":247},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":248,"text":"+note \"master slot's new xmin $xmin2, old xmin $xmin\";","html":"+note \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003cspan class=\"x x-first x-last\"\u003emaster slot's \u003c/span\u003enew xmin \u003cspan class=\"pl-smi\"\u003e$xmin2\u003c/span\u003e, old xmin \u003cspan class=\"pl-smi\"\u003e$xmin\u003c/span\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e;","displayNoNewLineWarning":false,"position":18,"left":248,"right":248},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":249,"text":" isnt($xmin2, $xmin, 'xmin of non-cascaded slot with hs feedback has changed');","html":" isnt(\u003cspan class=\"pl-smi\"\u003e$xmin2\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003e$xmin\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003exmin of non-cascaded slot with hs feedback has changed\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e);","displayNoNewLineWarning":false,"position":19,"left":249,"right":249},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":250,"text":" is($catalog_xmin2, '',","html":" is(\u003cspan class=\"pl-smi\"\u003e$catalog_xmin2\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e,","displayNoNewLineWarning":false,"position":20,"left":250,"right":250},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":251,"text":" \t'catalog xmin of non-cascaded slot still null with hs_feedback unchanged');","html":" \t\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003ecatalog xmin of non-cascaded slot still null with hs_feedback unchanged\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e);","displayNoNewLineWarning":false,"position":21,"left":251,"right":251},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":252,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":22,"left":252,"right":252},{"stylingDirective":null,"type":"DELETION","blobLineNumber":253,"text":"-wait_slot_xmins($node_standby_1, $slotname_2, \"xmin \u003c\u003e '$xmin'\");","html":"-wait_slot_xmins(\u003cspan class=\"pl-smi\"\u003e$node_standby_1\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003e$slotname_2\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003exmin \u0026lt;\u0026gt; '\u003cspan class=\"pl-smi\"\u003e$\u003cspan class=\"x x-first x-last\"\u003exmin\u003c/span\u003e\u003c/span\u003e'\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e);","displayNoNewLineWarning":false,"position":23,"left":253,"right":252},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":253,"text":"+wait_slot_xmins($node_standby_1, $slotname_2, \"xmin \u003c\u003e '$xmin1'\");","html":"+wait_slot_xmins(\u003cspan class=\"pl-smi\"\u003e$node_standby_1\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003e$slotname_2\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003exmin \u0026lt;\u0026gt; '\u003cspan class=\"pl-smi\"\u003e$\u003cspan class=\"x x-first x-last\"\u003exmin1\u003c/span\u003e\u003c/span\u003e'\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e);","displayNoNewLineWarning":false,"position":24,"left":253,"right":253},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":254,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":25,"left":254,"right":254},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":255,"text":" ($xmin2, $catalog_xmin2) = get_slot_xmins($node_standby_1, $slotname_2);","html":" (\u003cspan class=\"pl-smi\"\u003e$xmin2\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003e$catalog_xmin2\u003c/span\u003e) = get_slot_xmins(\u003cspan class=\"pl-smi\"\u003e$node_standby_1\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003e$slotname_2\u003c/span\u003e);","displayNoNewLineWarning":false,"position":26,"left":255,"right":255},{"stylingDirective":null,"type":"DELETION","blobLineNumber":256,"text":"-note \"new xmin $xmin2, old xmin $xmin\";","html":"-note \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003enew xmin \u003cspan class=\"pl-smi\"\u003e$xmin2\u003c/span\u003e, old xmin \u003cspan class=\"pl-smi\"\u003e$\u003cspan class=\"x x-first x-last\"\u003exmin\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e;","displayNoNewLineWarning":false,"position":27,"left":256,"right":255},{"stylingDirective":null,"type":"DELETION","blobLineNumber":257,"text":"-isnt($xmin2, $xmin, 'xmin of cascaded slot with hs feedback has changed');","html":"-isnt(\u003cspan class=\"pl-smi\"\u003e$xmin2\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003e$\u003cspan class=\"x x-first x-last\"\u003exmin\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003exmin of cascaded slot with hs feedback has changed\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003c/span\u003e);","displayNoNewLineWarning":false,"position":28,"left":257,"right":255},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":256,"text":"+note \"standby_1 slot's new xmin $xmin2, old xmin $xmin1\";","html":"+note \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003cspan class=\"x x-first x-last\"\u003estandby_1 slot's \u003c/span\u003enew xmin \u003cspan class=\"pl-smi\"\u003e$xmin2\u003c/span\u003e, old xmin \u003cspan class=\"pl-smi\"\u003e$\u003cspan class=\"x x-first x-last\"\u003exmin1\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e;","displayNoNewLineWarning":false,"position":29,"left":257,"right":256},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":257,"text":"+isnt($xmin2, $xmin1, 'xmin of cascaded slot with hs feedback has changed');","html":"+isnt(\u003cspan class=\"pl-smi\"\u003e$xmin2\u003c/span\u003e, \u003cspan class=\"pl-smi\"\u003e$\u003cspan class=\"x x-first x-last\"\u003exmin1\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003exmin of cascaded slot with hs feedback has changed\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003c/span\u003e);","displayNoNewLineWarning":false,"position":30,"left":257,"right":257},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":258,"text":" is($catalog_xmin2, '',","html":" is(\u003cspan class=\"pl-smi\"\u003e$catalog_xmin2\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e,","displayNoNewLineWarning":false,"position":31,"left":258,"right":258},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":259,"text":" \t'catalog xmin of cascaded slot still null with hs_feedback unchanged');","html":" \t\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003ecatalog xmin of cascaded slot still null with hs_feedback unchanged\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e);","displayNoNewLineWarning":false,"position":32,"left":259,"right":259},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":260,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":33,"left":260,"right":260}],"diffNumber":0,"diffSize":"0 Bytes","isBinary":false,"isTooBig":false,"collapsed":false,"isSubmodule":false,"lineCount":310,"linesChanged":14,"newTreeEntry":{"lineCount":310,"path":"src/test/recovery/t/001_stream_rep.pl","mode":100644,"isGenerated":false},"oldTreeEntry":{"lineCount":0,"path":"src/test/recovery/t/001_stream_rep.pl","mode":100644},"linesAdded":7,"linesDeleted":7,"path":"src/test/recovery/t/001_stream_rep.pl","pathDigest":"f549ebd886f77f9f39c932e5a51d1ea747ee2a03b8ff4657e513f210894ea1d2","status":"MODIFIED","truncatedReason":null,"oldOid":"ff68e909acd924b532e58c7699e93a1aff71654a","newOid":"ec86af917551f52246848dd148885df034273f3d","copilotChatReference":null,"deletedSha":"ff68e909acd924b532e58c7699e93a1aff71654a","canToggleRichDiff":false,"defaultToRichDiff":false,"proseDifffHtml":null,"renderInfo":null,"dependencyDiffPath":null,"submodule":null}],"splitViewPreference":"unified","ignoreWhitespace":false,"repoOwnerGlobalRelayId":"MDEyOk9yZ2FuaXphdGlvbjE3NzU0Mw==","commentsPreference":"visible","diffLineSpacingPreference":"relaxed","useMonospaceFont":false,"pasteUrlLinkAsPlainText":false,"userNotices":[],"path":"/postgres/postgres/commit/ec86af917551f52246848dd148885df034273f3d","fileTreeExpanded":true,"headerInfo":{"additions":7,"deletions":7,"filesChanged":1,"filesChangedString":"1"},"moreDiffsToLoad":false,"asyncDiffLoadInfo":{"startIndex":1,"truncated":false,"byteCount":1694,"lineShownCount":34},"commentInfo":{"canComment":false,"locked":false,"canLock":false,"repoArchived":false},"csrf_tokens":{"/users/diffview?diff=split":{"post":"vz1DbwvKYJUTOaVCy85UXyYTXPzq_pOHia0Y0RYDN9jqh89615C2pI4GMp4zQreLA9b0pAgu7G6GshgJz37kqQ"},"/users/diffview?diff=unified":{"post":"sXq6l3EW9vi0o0XL7UEfquBEYPLG7GXqTo4fUYSSmZHkwDaCrUwgySmc0hcVzfx-xYHIqiQ8GgNBkR-JXe9K4A"},"/notifications/thread":{"post":"5XVRqg7_z0GIjnzQY-ZQd_-e4g-BHqoqq3xeDJi5VDBdrc6LxufvD1NnBdN7cfzEbkcjw5gvy-pK6K6LKjZJxg"}}},"title":"Fix another race-condition-ish issue in recovery/t/001_stream_rep.pl. · postgres/postgres@ec86af9","appPayload":{"helpUrl":"https://docs.github.com","findInDiffWorkerPath":"/assets-cdn/worker/find-in-diff-worker-2bfe39677d14.js","enabled_features":{"diff_ux_refresh_beta":false,"diff_inline_comments":true,"diff_ux_refresh_ssr_five":false,"diff_ux_refresh_ssr_ten":false,"react_diff_line_type_character_correction":true}}}
Fix another race-condition-ish issue in recovery/t/001_stream_rep.pl.
Buildfarm members hornet and sungazer have shown multiple instances of
"Failed test 'xmin of non-cascaded slot with hs feedback has changed'".
The reason seems to be that the test is checking the current xmin of the
master server's replication slot against a past xmin of the first slave
server's replication slot. Even though the latter slot is downstream of
the former, it's possible for its reported xmin to be ahead of the former's
reported xmin, because those numbers are updated whenever the respective
downstream walreceiver feels like it (see logic in WalReceiverMain).
Instrumenting this test shows that indeed the slave slot's xmin does often
advance before the master's does, especially if an autovacuum transaction
manages to occur during the relevant window. If we happen to capture such
an advanced xmin as $xmin, then the subsequent wait_slot_xmins call can
fall through before the master's xmin has advanced at all, and then if it
advances before the get_slot_xmins call, we can get the observed failure.
Yeah, that's a bit of a long chain of deduction, but it's hard to explain
any other way how the test can get past an "xmin <> '$xmin'" check only
to have the next query find that xmin does equal $xmin.
Fix by keeping separate images of the master and slave slots' xmins
and testing their has-xmin-advanced conditions independently.
0 commit comments