Upstream acknowledged and fixed this bug on all current PgPool versions,
applying a patch for a broader set of cases
http://www.pgpool.net/mantisbt/view.php?id=60
It would be great if the latest 3.1 release was proposed as a Wheezy
update, since it doesn't add new functionality, just bugfixes. In any
event, I backported the patch to 3.1.3 as shipped by Debian (attached),
and it works fine.
--
Prof. Ernesto Hernández-Novich - MYS-220C - @iamemhn
Geek by nature, Linux by choice, Debian of course.
If you can't aptitude it, it isn't useful or doesn't exist.
GPG Key Fingerprint = 438C 49A2 A8C7 E7D7 1500 C507 96D6 A3D6 2F4C 85E3
--- a/pool_process_query.c
+++ b/pool_process_query.c
@@ -77,6 +77,7 @@
static POOL_STATUS add_lock_target(POOL_CONNECTION *frontend, POOL_CONNECTION_POOL *backend, char* table);
static bool has_lock_target(POOL_CONNECTION *frontend, POOL_CONNECTION_POOL *backend, char* table, bool for_update);
static POOL_STATUS insert_oid_into_insert_lock(POOL_CONNECTION *frontend, POOL_CONNECTION_POOL *backend, char* table);
+static bool is_all_slaves_command_complete(unsigned char *kind_list, int num_backends, int master);
/* timeout sec for pool_check_fd */
static int timeoutsec;
@@ -3453,6 +3454,27 @@
}
/*
+ * returns true if all slaves status are 'C' (Command Complete)
+ */
+static bool is_all_slaves_command_complete(unsigned char *kind_list, int num_backends, int master)
+{
+ int i;
+ int ok = true;
+
+ for (i=0;i<num_backends;i++)
+ {
+ if (i == master || kind_list[i] == 0)
+ continue;
+ if (kind_list[i] != 'C')
+ {
+ ok = false;
+ break;
+ }
+ }
+ return ok;
+}
+
+/*
* read_kind_from_backend: read kind from backends.
* the "frontend" parameter is used to send "kind mismatch" error message to the frontend.
* the out parameter "decided_kind" is the packet kind decided by this function.