Jan Wieck wieck at lists.slony.info
Thu Sep 27 07:23:01 PDT 2007
Update of /home/cvsd/slony1/slony1-engine/src/slon
In directory main.slony.info:/tmp/cvs-serv12317/src/slon

Modified Files:
	remote_worker.c 
Log Message:
Fixing the archive sequence generations. All non-SYNC events must
start the local transaction before creating the archive as well, so
that the lock on the archive counter table serializes archive creation.

Test 8 is getting expanded bit by bit into a mega-test.


Jan


Index: remote_worker.c
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/src/slon/remote_worker.c,v
retrieving revision 1.155
retrieving revision 1.156
diff -C2 -d -r1.155 -r1.156
*** remote_worker.c	17 Sep 2007 22:04:18 -0000	1.155
--- remote_worker.c	27 Sep 2007 14:22:59 -0000	1.156
***************
*** 585,588 ****
--- 585,592 ----
  						{
  							slon_log(SLON_FATAL, "ABORT at sync %d per command line request%n", quit_sync_finalsync);
+ 							slon_mkquery(&query2, "rollback transaction; ");
+ 							query_execute(node, local_dbconn, &query2);
+ 							dstring_reset(&query2);
+ 
  							slon_retry();
  						}
***************
*** 633,636 ****
--- 637,641 ----
  				 * specified timeout.
  				 */
+ 				archive_terminate(node);
  				(void) slon_mkquery(&query2, "rollback transaction");
  				if (query_execute(node, local_dbconn, &query2) < 0)
***************
*** 662,666 ****
  				slon_retry();
  		}
! 		else
  		{
  			/*
--- 667,671 ----
  				slon_retry();
  		}
! 		else /* not SYNC */
  		{
  			/*
***************
*** 671,674 ****
--- 676,682 ----
  							 "lock table %s.sl_config_lock; ",
  							 rtcfg_namespace);
+ 			if (query_execute(node, local_dbconn, &query1) < 0)
+ 				slon_retry();
+ 			dstring_reset(&query1);
  
  			/*
***************
*** 4254,4265 ****
  		if (rc < 0)
  			slon_retry();
- 			
- 		if (command_on_logarchive) {
- 			char command[512];
- 			sprintf(command, "%s %s", command_on_logarchive, node->archive_name);
- 			slon_log(SLON_DEBUG1, "remoteWorkerThread_%d: Run Archive Command %s\n",
- 				 node->no_id, command);
- 			system(command);
- 		}
  	}
  
--- 4262,4265 ----
***************
*** 5041,5045 ****
  	
  	sprintf(node->archive_name, "%s/slony1_log_%d_", archive_dir, 
! 			node->no_id);
  	for (i = strlen(node->archive_counter); i < 20; i++)
  		strcat(node->archive_name, "0");
--- 5041,5045 ----
  	
  	sprintf(node->archive_name, "%s/slony1_log_%d_", archive_dir, 
! 			rtcfg_nodeid);
  	for (i = strlen(node->archive_counter); i < 20; i++)
  		strcat(node->archive_name, "0");
***************
*** 5146,5149 ****
--- 5146,5157 ----
  	}
  
+ 	if (command_on_logarchive) {
+ 		char command[1024];
+ 		sprintf(command, "%s %s", command_on_logarchive, node->archive_name);
+ 		slon_log(SLON_DEBUG1, "remoteWorkerThread_%d: Run Archive Command %s\n",
+ 			 node->no_id, command);
+ 		system(command);
+ 	}
+ 
  	return 0;
  }



More information about the Slony1-commit mailing list