Wed Jun 28 14:40:06 PDT 2006
- Previous message: [Slony1-commit] By cbbrowne: Slony-I state test scripts...
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Log Message:
-----------
Two changes to remote_worker.c:
1. Add in a logging statement at level 2 that lists the numbers
of updates, inserts, and deletes that were processed as part
of the SYNC.
2. Log shipping...
The final close_log_archive() had not included error checking.
Add in setting rc, and failing with a proper error message
should this call fail.
Modified Files:
--------------
slony1-engine/src/slon:
remote_worker.c (r1.114 -> r1.115)
-------------- next part --------------
Index: remote_worker.c
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/src/slon/remote_worker.c,v
retrieving revision 1.114
retrieving revision 1.115
diff -Lsrc/slon/remote_worker.c -Lsrc/slon/remote_worker.c -u -w -r1.114 -r1.115
--- src/slon/remote_worker.c
+++ src/slon/remote_worker.c
@@ -4915,7 +4915,15 @@
*/
if (archive_dir)
{
- close_log_archive();
+ rc = close_log_archive();
+ if (rc < 0)
+ {
+ slon_log(SLON_ERROR, "remoteWorkerThread_%d: "
+ "Could not close out archive file %s - %s\n",
+ node->no_id, archive_tmp, strerror(errno));
+ return 60;
+
+ }
if (command_on_logarchive) {
char command[512];
sprintf(command, "%s %s", command_on_logarchive, archive_name);
@@ -4974,6 +4982,12 @@
int line_no;
int line_ncmds;
+ int num_inserts, num_deletes, num_updates;
+
+ num_inserts = 0;
+ num_deletes = 0;
+ num_updates = 0;
+
dstring_init(&query);
dstring_init(&query2);
@@ -5417,6 +5431,7 @@
"insert into %s %s;\n",
wd->tab_fqname[log_tableid],
log_cmddata);
+ num_inserts ++;
break;
case 'U':
@@ -5424,6 +5439,7 @@
"update only %s set %s;\n",
wd->tab_fqname[log_tableid],
log_cmddata);
+ num_updates ++;
break;
case 'D':
@@ -5431,6 +5447,7 @@
"delete from only %s where %s;\n",
wd->tab_fqname[log_tableid],
log_cmddata);
+ num_deletes ++;
break;
}
line_ncmds++;
@@ -5534,6 +5551,13 @@
node->no_id, provider->no_id,
TIMEVAL_DIFF(&tv_start, &tv_now));
+ slon_log(SLON_DEBUG2, "remoteHelperThread_%d_%d: inserts=%d updates=%d deletes=%d\n",
+ node->no_id, provider->no_id, num_inserts, num_updates, num_deletes);
+
+ num_inserts = 0;
+ num_deletes = 0;
+ num_updates = 0;
+
/*
* Change our helper status to DONE and tell the worker thread about
* it.
- Previous message: [Slony1-commit] By cbbrowne: Slony-I state test scripts...
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Slony1-commit mailing list