patch-3 (3-allow-wal-record-header-to-be-split.patch)WAL Format Changes
От | Amit kapila |
---|---|
Тема | patch-3 (3-allow-wal-record-header-to-be-split.patch)WAL Format Changes |
Дата | |
Msg-id | 6C0B27F7206C9E4CA54AE035729E9C3828513A55@szxeml509-mbx обсуждение исходный текст |
Ответы |
Re: patch-3 (3-allow-wal-record-header-to-be-split.patch)WAL Format
Changes
|
Список | pgsql-hackers |
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;"><p>While reading patch-3 (3-allow-wal-record-header-to-be-split.patch)of<br /> WAL Format<br /> Changes(<a href="http://archives.postgresql.org/message-id/4FDA5136.6080206@enterprisedb.com">http://archives.postgresql.org/message-id/4FDA5136.6080206@enterprisedb.com</a>), Ihad few observations which are summarized below:<br /><br /> 1.<br /> ReadRecord(XLogRecPtr *RecPtr, int emode, bool fetching_ckpt)<br/> + /*<br /> + * If we got the whole header already, validate it immediately. Otherwise<br /> + * wevalidate it after reading the rest of the header from the next page.<br /> + */<br /> + if (targetRecOff <= XLOG_BLCKSZ- SizeOfXLogRecord)<br /> + {<br /> + if (!ValidXLogRecordHeader(RecPtr, record, emode, randAccess))<br /> + gotonext_record_is_invalid;<br /> + gotheader = true;<br /> + }<br /> + else<br /> + gotheader = false;<br /> +<p>Shouldn'tthe record header validation be done before the check for allocating a bigger record buffer based <br /> ontotal length. Otherwise it may lead to allocation of bigger buffer which may not be required if record header is invalid.<br/> In cases where record header is not split, validation can be done before otherwise it can be done later.<p> <p><br/> 3. General observation, not related to your changes <br /> XLogInsert(RmgrId rmid, uint8 info, XLogRecData*rdata) <br /> . <br /> . <br /> if (freespace == 0) <br /> { <br /> updrqst= AdvanceXLInsertBuffer(false); <p><br /> In the code, AdvanceXLInsertBuffer(false); is called after starting criticalsection and acquiring <br /> WALInsertLock, now if any error occurs inside AdvanceXLInsertBuffer() <br /> (in oneof the paths it calls XLogWrite(), from which it can call XLogFileInit() where error can occur); <br /> how will it releaseWALInsertLock or end critical section. <p> <p> <p>With Regards,<p>Amit Kapila.</div>
В списке pgsql-hackers по дате отправления: