* Begin constructing a WAL record. This must be called before the * XLogRegister* functions and XLogInsert(). */
| 129 | * XLogRegister* functions and XLogInsert(). |
| 130 | */ |
| 131 | void |
| 132 | XLogBeginInsert(void) |
| 133 | { |
| 134 | Assert(max_registered_block_id == 0); |
| 135 | Assert(mainrdata_last == (XLogRecData *) &mainrdata_head); |
| 136 | Assert(mainrdata_len == 0); |
| 137 | |
| 138 | /* cross-check on whether we should be here or not */ |
| 139 | if (!XLogInsertAllowed()) |
| 140 | elog(ERROR, "cannot make new WAL entries during recovery"); |
| 141 | |
| 142 | if (begininsert_called) |
| 143 | elog(ERROR, "XLogBeginInsert was already called"); |
| 144 | |
| 145 | begininsert_called = true; |
| 146 | } |
| 147 | |
| 148 | /* |
| 149 | * Ensure that there are enough buffer and data slots in the working area, |
no test coverage detected