You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@vcl.apache.org by jf...@apache.org on 2015/03/30 21:12:35 UTC
svn commit: r1670182 - in /vcl/trunk/web/.ht-inc: requests.php
xmlrpcWrappers.php
Author: jfthomps
Date: Mon Mar 30 19:12:34 2015
New Revision: 1670182
URL: http://svn.apache.org/r1670182
Log:
VCL-763 - Add missing constraints to database tables
requests.php: modified AJeditRequest: fixed call to retryGetSemaphore where '1' was passed for $imageid and $imagerevisionid - the image being added to the semaphore table is not important in this case, but with the foreign key constraint, they need to be values actually in those tables
xmlrpcWrappers.php: modified XMLRPCextendRequest and XMLRPCsetRequestEnding: fixed calls to retryGetSemaphore where '1' was passed for $imageid and $imagerevisionid - the image being added to the semaphore table is not important in this case, but with the foreign key constraint, they need to be values actually in those tables
Modified:
vcl/trunk/web/.ht-inc/requests.php
vcl/trunk/web/.ht-inc/xmlrpcWrappers.php
Modified: vcl/trunk/web/.ht-inc/requests.php
URL: http://svn.apache.org/viewvc/vcl/trunk/web/.ht-inc/requests.php?rev=1670182&r1=1670181&r2=1670182&view=diff
==============================================================================
--- vcl/trunk/web/.ht-inc/requests.php (original)
+++ vcl/trunk/web/.ht-inc/requests.php Mon Mar 30 19:12:34 2015
@@ -3247,9 +3247,13 @@ function AJeditRequest() {
# get semaphore on each existing node in cluster so that nothing
# can get moved to the nodes during this process
+ $resources = getUserResources(array("imageAdmin", "imageCheckOut"));
+ $tmp = array_keys($resources['image']);
+ $semimageid = $tmp[0];
+ $semrevid = getProductionRevisionid($semimageid);
$checkend = unixToDatetime($unixend + 900);
foreach($request["reservations"] as $res) {
- if(! retryGetSemaphore(1, 1, $res['managementnodeid'], $res['computerid'], $request['start'], $checkend, $requestid)) {
+ if(! retryGetSemaphore($semimageid, $semrevid, $res['managementnodeid'], $res['computerid'], $request['start'], $checkend, $requestid)) {
$lockedall = 0;
break;
}
Modified: vcl/trunk/web/.ht-inc/xmlrpcWrappers.php
URL: http://svn.apache.org/viewvc/vcl/trunk/web/.ht-inc/xmlrpcWrappers.php?rev=1670182&r1=1670181&r2=1670182&view=diff
==============================================================================
--- vcl/trunk/web/.ht-inc/xmlrpcWrappers.php (original)
+++ vcl/trunk/web/.ht-inc/xmlrpcWrappers.php Mon Mar 30 19:12:34 2015
@@ -967,14 +967,18 @@ function XMLRPCextendRequest($requestid,
// check for computer being available for extended time?
$timeToNext = timeToNextReservation($request);
$movedall = 1;
+ $resources = getUserResources(array("imageAdmin", "imageCheckOut"));
+ $tmp = array_keys($resources['image']);
+ $semimageid = $tmp[0];
+ $semrevid = getProductionRevisionid($semimageid);
if($timeToNext > -1) {
$lockedall = 1;
if(count($request['reservations']) > 1) {
# get semaphore on each existing node in cluster so that nothing
# can get moved to the nodes during this process
- $checkend = unixToDatetime($unixend + 900);
+ $checkend = unixToDatetime($endts + 900);
foreach($request["reservations"] as $res) {
- if(! retryGetSemaphore(1, 1, $res['managementnodeid'], $res['computerid'], $request['start'], $checkend, $requestid)) {
+ if(! retryGetSemaphore($semimageid, $semrevid, $res['managementnodeid'], $res['computerid'], $request['start'], $checkend, $requestid)) {
$lockedall = 0;
break;
}
@@ -1132,9 +1136,14 @@ function XMLRPCsetRequestEnding($request
if(count($request['reservations']) > 1) {
# get semaphore on each existing node in cluster so that nothing
# can get moved to the nodes during this process
+ $unixend = datetimeToUnix($request['end']);
$checkend = unixToDatetime($unixend + 900);
+ $resources = getUserResources(array("imageAdmin", "imageCheckOut"));
+ $tmp = array_keys($resources['image']);
+ $semimageid = $tmp[0];
+ $semrevid = getProductionRevisionid($semimageid);
foreach($request["reservations"] as $res) {
- if(! retryGetSemaphore(1, 1, $res['managementnodeid'], $res['computerid'], $request['start'], $checkend, $requestid)) {
+ if(! retryGetSemaphore($semimageid, $semrevid, $res['managementnodeid'], $res['computerid'], $request['start'], $checkend, $requestid)) {
$lockedall = 0;
break;
}