hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From y...@apache.org
Subject incubator-hawq git commit: HAWQ-344. When resource queue capacity is shrunk, deadlock detection maybe not triggered. Fix connection counter bug.
Date Thu, 21 Jan 2016 02:36:56 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master b95ed2513 -> e21d5257e


HAWQ-344. When resource queue capacity is shrunk, deadlock detection maybe not triggered.
Fix connection counter bug.


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

Branch: refs/heads/master
Commit: e21d5257ebfcc826d5a17b159e3fe1918edb6084
Parents: b95ed25
Author: YI JIN <yjin@pivotal.io>
Authored: Thu Jan 21 13:36:10 2016 +1100
Committer: YI JIN <yjin@pivotal.io>
Committed: Thu Jan 21 13:36:10 2016 +1100

----------------------------------------------------------------------
 src/backend/resourcemanager/resqueuemanager.c | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/e21d5257/src/backend/resourcemanager/resqueuemanager.c
----------------------------------------------------------------------
diff --git a/src/backend/resourcemanager/resqueuemanager.c b/src/backend/resourcemanager/resqueuemanager.c
index 9ccf619..1f27525 100644
--- a/src/backend/resourcemanager/resqueuemanager.c
+++ b/src/backend/resourcemanager/resqueuemanager.c
@@ -2173,6 +2173,7 @@ void returnConnectionToQueue(ConnectionTrack conntrack, bool istimeout)
 	track->CurConnCounter--;
 	if ( track->CurConnCounter == 0 )
 	{
+		elog(RMLOG, "Resource queue %s becomes idle.", track->QueueInfo->Name);
 		track->isBusy = false;
 		refreshMemoryCoreRatioLimits();
 		refreshMemoryCoreRatioWaterMark();
@@ -4593,6 +4594,18 @@ void detectAndDealWithDeadLock(DynResourceQueueTrack track)
 			MEMORY_CONTEXT_SWITCH_TO(PCONTEXT)
 			PCONTRACK->ConnToSend = lappend(PCONTRACK->ConnToSend, canceltrack);
 			MEMORY_CONTEXT_SWITCH_BACK
+
+			/* Recycle connection track instance. */
+			Assert(track->CurConnCounter > 0);
+			track->CurConnCounter--;
+			if ( track->CurConnCounter == 0 )
+			{
+				elog(RMLOG, "Resource queue %s becomes idle after deadlock checking.",
+							track->QueueInfo->Name);
+				track->isBusy = false;
+				refreshMemoryCoreRatioLimits();
+				refreshMemoryCoreRatioWaterMark();
+			}
 		}
 	}
 }
@@ -5527,6 +5540,19 @@ void applyResourceQueueTrackChangesFromShadows(List *quehavingshadow)
 				MEMORY_CONTEXT_SWITCH_TO(PCONTEXT)
 				PCONTRACK->ConnToSend = lappend(PCONTRACK->ConnToSend, conn);
 				MEMORY_CONTEXT_SWITCH_BACK
+
+				/* Recycle connection track instance. */
+				Assert(quetrack->CurConnCounter > 0);
+				quetrack->CurConnCounter--;
+				if ( quetrack->CurConnCounter == 0 )
+				{
+					elog(RMLOG, "Resource queue %s becomes idle after applying "
+								"change from its shadow.",
+								quetrack->QueueInfo->Name);
+					quetrack->isBusy = false;
+					refreshMemoryCoreRatioLimits();
+					refreshMemoryCoreRatioWaterMark();
+				}
 			}
 			else
 			{


Mime
View raw message