hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m..@apache.org
Subject incubator-hawq git commit: HAWQ-569. Fixing an assertion failure and a potential double release of workfile_queryspace queryEntry
Date Thu, 24 Mar 2016 08:08:21 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 598ec5892 -> 1d1c85460


HAWQ-569. Fixing an assertion failure and a potential double release of workfile_queryspace
queryEntry


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/1d1c8546
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/1d1c8546
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/1d1c8546

Branch: refs/heads/master
Commit: 1d1c85460a47ced129ec581db755d7a9d387a61c
Parents: 598ec58
Author: Foyzur Rahman <foyzur.rahman@gopivotal.com>
Authored: Mon Feb 29 19:09:48 2016 -0800
Committer: Ming LI <mli@pivotal.io>
Committed: Thu Mar 24 16:03:34 2016 +0800

----------------------------------------------------------------------
 .../utils/workfile_manager/workfile_queryspace.c     | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/1d1c8546/src/backend/utils/workfile_manager/workfile_queryspace.c
----------------------------------------------------------------------
diff --git a/src/backend/utils/workfile_manager/workfile_queryspace.c b/src/backend/utils/workfile_manager/workfile_queryspace.c
index a421ceb..7010229 100644
--- a/src/backend/utils/workfile_manager/workfile_queryspace.c
+++ b/src/backend/utils/workfile_manager/workfile_queryspace.c
@@ -302,7 +302,6 @@ WorkfileQueryspace_ReleaseEntry(void)
 	}
 
 	querySpaceNestingLevel--;
-	Assert(querySpaceNestingLevel >= 0);
 
 	if (querySpaceNestingLevel > 0)
 	{
@@ -313,15 +312,25 @@ WorkfileQueryspace_ReleaseEntry(void)
 		return;
 	}
 
+	int session_id = queryEntry->key.session_id;
+	int command_count = queryEntry->key.command_count;
+
 	bool deleted = SyncHTRelease(queryspace_Hashtable, queryEntry);
 
+	/*
+	 * Set the queryEntry to NULL as we may soon CHECK_FOR_INTERRUPTS, which can come back to
this
+	 * method if an ERROR cleanup (e.g., because of a QueryCancelPending) invokes ExecutorEnd.
+	 * We don't want to release our queryEntry again.
+	 */
+	queryEntry = NULL;
+
 	if (deleted)
 	{
 		elog(gp_workfile_caching_loglevel, "Deleted entry for query (sessionid=%d, commandcnt=%d)",
-				queryEntry->key.session_id, queryEntry->key.command_count);
+				session_id, command_count);
 	}
 
-	queryEntry = NULL;
+	Assert(querySpaceNestingLevel >= 0);
 }
 
 /*


Mime
View raw message