Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

PostgreSQL starts the switching of log sources during recovery

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

The log source will be switched directly in XLOG_FROM_ARCHIVE- > XLOG_FROM_STREAM- > XLOG_FROM_ARCHIVE. If there is an error in the reading process, it will switch to another log source. However, in the actual execution process, XLOG_FROM_ARCHIVE will be read to XLOG_FROM_PG_WAL after an error, but the variables of the log source will not be changed. This requires attention.

Static intXLogFileReadAnyTLI (XLogSegNo segno, int emode, int source) {if (expectedTLEs) tles = expectedTLEs; else tles = readTimeLineHistory (recoveryTargetTLI) / * 1. When WaitForWALToBecomeAvailable is called, when source is XLOG_FROM_ARCHIVE, XLOG_FROM_ANY 2 and XLOG_FROM_ANY will be used, and xlog will be read from the archive first. If open fails, XLOG_FROM_PG_WAL 3 will be used. External log source variables do not switch * / foreach (cell, tles) {TimeLineID tli = ((TimeLineHistoryEntry *) lfirst (cell))-> tli If (tli < curFileTLI) break; / * don't bother looking at too-old TLIs * / if (source = = XLOG_FROM_ANY | | source = = XLOG_FROM_ARCHIVE) {fd = XLogFileRead (segno, emode, tli,XLOG_FROM_ARCHIVE, true) If (fd! =-1) {if (! expectedTLEs) expectedTLEs = tles; return fd }} if (source = = XLOG_FROM_ANY | | source = = XLOG_FROM_PG_WAL) {fd = XLogFileRead (segno, emode, tli, XLOG_FROM_PG_WAL, true) If (fd! =-1) {if (! expectedTLEs) expectedTLEs = tles; return fd;} return-1;}

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

  • T-SQL Advanced query of SQL Server Database

    1. For the functions used in the query, please create your own database and table, and insert data into the table. My example is as follows: create database accp;

    © 2024 shulou.com SLNews company. All rights reserved.

    12
    Report