In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
I. introduction
Add a use case as an error chapter of pg_rewind to illustrate its usage.
II. Examples
1. History file
-- New owner $cat 00000004.history1 0/140000C8 no recovery target specified2 0max 19000060 no recovery target specified3 0/1F000090 no recovery target specified-- Old owner $cat 00000003.history1 0/140000C8 no recovery target specified2 0max 19000060 no recovery target specified
2. Find bifurcation points
Description: findCommonAncestorTimeline:
1) if you compare the timeline of sourceHistory [0], targetHistory [0] and begin, you can find that they are equal, then go to the comparison of the second entry.
2) if you compare the timeline of sourceHistory [1] and targetHistory [1] with the value of begin, you can find that they are equal, then go to the comparison of the third entry
3) comparing the timeline of sourceHistory [2], targetHistory [2] and begin, we can find that they are equal, and the comparison ends at this time.
4) return the third entry: MinXLogRecPtr (sourceHistory [I] .end, targetHistory [I] .end). In this case, the value of sourceHistory [I] .end is returned as the bifurcation point, that is, 0/1F000090.
3. At this time, ControlFile_target.checkPoint < divergerec & & target's chkpattendant recycle assigned gerec, so pg_rewind can be done.
4. FindLastCheckpoint looks for the nearest checkpoint before the bifurcation point divergerec as the starting point of rewind.
1) first, you need to locate the record at the beginning of the bifurcation point divergerec, and then locate the previous wal record according to the xl_prev pointer of the record
2) determine whether the wal record obtained in step 1) is checkpoint, and if not, return to 1) until the checkpoint point is found
3) there is a problem here. If the bifurcation point is exactly the end position of the old master, that is, in this example: 1F000090 is the bifurcation point, in fact, there is no data bifurcation between the old master and the new master, so it can be considered that the new master data has not been received as a backup.
4) when target starts to get the prev pointer from the position 1F000090 and looks for the checkpoint forward, it cannot continue to traverse down to find it because it is all zero after this position. Error: could not find previous WAL record at% Xmax% X
III. Summary
When the pg_rewind is executed here, it is impossible to determine the scenario without bifurcations, that is, the scenario of this article. At this point, executing pg_rewind will report an error, making the user think that the execution of pg_rewind failed due to corruption of the WAL file. Wouldn't it be better if this tool can identify this scenario and say that it doesn't need rewind?
Fourth, pg_rewind principle and error reporting process analysis reference
Http://blog.itpub.net/31493717/viewspace-2639207/
Http://blog.itpub.net/31493717/viewspace-2286140/
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.