Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Troubleshooting PostgreSQL

You're reading from  Troubleshooting PostgreSQL

Product type Book
Published in Mar 2015
Publisher Packt
ISBN-13 9781783555314
Pages 164 pages
Edition 1st Edition
Languages

Table of Contents (17) Chapters

Troubleshooting PostgreSQL
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Installing PostgreSQL 2. Creating Data Structures 3. Handling Indexes 4. Reading Data Efficiently and Correctly 5. Getting Transactions and Locking Right 6. Writing Proper Procedures 7. PostgreSQL Monitoring 8. Fixing Backups and Replication 9. Handling Hardware and Software Disasters 10. A Standard Approach to Troubleshooting Index

Handling timelines


If you've got only two servers, timelines are really not an issue. However, if a setup grows larger, understanding timelines can be vital to success. What is this all about? When a server is promoted from a slave to a master, it increments its timeline. This is done to ensure that in a large setup, the right xlog is consumed by each server.

In the case of two servers, this is not an issue. If everything is fine, both servers will start in timeline 1. In case the master dies, the remaining server will switch to timeline 2, and everything will be fine.

But what about a setup consisting of three servers? In case the master crashes, one of those remaining servers will be the next master. But who should be the next master? That is for you to decide. You cannot just take a random server. It is important to check which server has received how much transaction log, and decide on the most advanced server. This is how you can figure it out:

SELECT pg_last_xlog_replay_location();

But...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}