mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-03 09:13:20 +03:00 
			
		
		
		
	pg_upgrade: issue helpful error message for use on standbys
Commit 777e6ddf17 checked for a shut down
message from a standby and allowed it to continue.  This patch reports a
helpful error message in these cases, suggesting to use rsync as
documented.
Diagnosed-by: Martín Marqués
Discussion: https://postgr.es/m/CAPdiE1xYCow-reLjrhJ9DqrMu-ppNq0ChUUEvVdxhdjGRD5_eA@mail.gmail.com
Backpatch-through: 9.3
			
			
This commit is contained in:
		@@ -148,8 +148,14 @@ get_control_data(ClusterInfo *cluster, bool live_check)
 | 
				
			|||||||
				/* remove leading spaces */
 | 
									/* remove leading spaces */
 | 
				
			||||||
				while (*p == ' ')
 | 
									while (*p == ' ')
 | 
				
			||||||
					p++;
 | 
										p++;
 | 
				
			||||||
				if (strcmp(p, "shut down\n") != 0 &&
 | 
									if (strcmp(p, "shut down in recovery\n") == 0)
 | 
				
			||||||
					strcmp(p, "shut down in recovery\n") != 0)
 | 
									{
 | 
				
			||||||
 | 
										if (cluster == &old_cluster)
 | 
				
			||||||
 | 
											pg_log(PG_FATAL, "The source cluster was shut down while in recovery mode.  To upgrade, use \"rsync\" as documented or shut it down as a primary.\n");
 | 
				
			||||||
 | 
										else
 | 
				
			||||||
 | 
											pg_log(PG_FATAL, "The target cluster was shut down while in recovery mode.  To upgrade, use \"rsync\" as documented or shut it down as a primary.\n");
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
									else if (strcmp(p, "shut down\n") != 0)
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					if (cluster == &old_cluster)
 | 
										if (cluster == &old_cluster)
 | 
				
			||||||
						pg_log(PG_FATAL, "The source cluster was not shut down cleanly.\n");
 | 
											pg_log(PG_FATAL, "The source cluster was not shut down cleanly.\n");
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user