Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/maint-4.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
sjones4 committed Nov 26, 2018
2 parents 37d9ae7 + e722a01 commit fb3de89
Show file tree
Hide file tree
Showing 33 changed files with 135 additions and 89 deletions.
16 changes: 0 additions & 16 deletions clc/modules/postgresql/conf/scripts/setup_db.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,6 @@ class PostgresqlBootstrapper extends Bootstrapper.Simple implements DatabaseBoot
try {
kernelParametersCheck( )

if ( !versionCheck( ) ){
throw new RuntimeException("Postgres versions less than 9.1.X are not supported")
}

if ( !initDatabase( ) ) {
throw new RuntimeException("Unable to initialize the postgres database")
}
Expand Down Expand Up @@ -305,18 +301,6 @@ class PostgresqlBootstrapper extends Bootstrapper.Simple implements DatabaseBoot
}
}

// Version check to ensure only Postgres 9.X creates the db.
private boolean versionCheck( ) {
try {
String cmd = newCommands.initdb + " --version"
def pattern = ~/.*\s+9\.[1-9]\d*(\.\d+)*$/
pattern.matcher( cmd.execute( ).text.trim( ) ).matches( )
} catch ( Exception e ) {
LOG.fatal("Unable to find the initdb command")
false
}
}

private boolean initDatabase( ) throws Exception {
final File passFile = new File( PG_PASSWORDFILE )
try {
Expand Down
2 changes: 1 addition & 1 deletion cluster/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ VNLIBS= ../util/euca_network.o ../util/log.o ../util/fault.o ../util/wc.o ../uti
WSSECLIBS=../util/euca_axis.o ../util/euca_auth.o
CC_LIBS = ../util/config.o ${LIBS} ${LDFLAGS} -lcurl -lssl -lcrypto -lrampart
STATS_OBJS= ../util/stats/stats.o ../util/stats/sensor_common.o ../util/stats/message_sensor.o ../util/stats/service_sensor.o ../util/stats/fs_emitter.o ../util/stats/message_stats.o
STATS_LIBS=-ljson -ljson-c -lm
STATS_LIBS=-ljson-c -lm
CFLAGS +=

all: generated/stubs
Expand Down
6 changes: 3 additions & 3 deletions cluster/handlers-state.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,9 +353,9 @@ int doDescribeServices(ncMetadata * pMeta, serviceInfoType * serviceIds, int ser
}
myStatus->localEpoch = config->ccStatus.localEpoch;
sprintf(myStatus->serviceId.type, "node");
sprintf(myStatus->serviceId.name, r->hostname);
sprintf(myStatus->serviceId.partition, config->ccStatus.serviceId.partition);
sprintf(myStatus->serviceId.uris[0], r->ncURL);
sprintf(myStatus->serviceId.name, "%s", r->hostname);
sprintf(myStatus->serviceId.partition, "%s", config->ccStatus.serviceId.partition);
sprintf(myStatus->serviceId.uris[0], "%s", r->ncURL);
myStatus->serviceId.urisLen = 1;
LOGDEBUG("external services\t uri[%d]: %s %s %s %s %s\n",
idIdx, myStatus->serviceId.type, myStatus->serviceId.partition, myStatus->serviceId.name, myStatus->localState, myStatus->serviceId.uris[0]);
Expand Down
4 changes: 2 additions & 2 deletions cluster/handlers.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
#include <signal.h>
#include <math.h>
#include <assert.h>
#include <json/json.h>
#include <json-c/json.h>

#include <eucalyptus.h>
#include "axis2_skel_EucalyptusCC.h"
Expand Down Expand Up @@ -1999,7 +1999,7 @@ int doDescribeResources(ncMetadata * pMeta, virtualMachine ** ccvms, int vmLen,
euca_strncat(logStr, typeStr, 2047);
}
euca_strncat(logStr, "\n", 2047);
LOGDEBUG(logStr);
LOGDEBUG("%s", logStr);
/*
if (vmLen >= 5) {
LOGDEBUG("resources summary ({avail/max}): %s{%d/%d} %s{%d/%d} %s{%d/%d} %s{%d/%d} %s{%d/%d}\n", (*ccvms)[0].name,
Expand Down
6 changes: 3 additions & 3 deletions cluster/server-marshal.c
Original file line number Diff line number Diff line change
Expand Up @@ -2062,7 +2062,7 @@ adb_MigrateInstancesResponse_t *MigrateInstancesMarshal(adb_MigrateInstances_t *
}
}
if (ccMeta.replyString != NULL) { // if replyString is set, we have a more detailed status/error message
snprintf(statusMessage, sizeof(statusMessage), ccMeta.replyString);
snprintf(statusMessage, sizeof(statusMessage), "%s", ccMeta.replyString);
EUCA_FREE(ccMeta.replyString); // the caller must free
}

Expand Down Expand Up @@ -2133,7 +2133,7 @@ adb_StartInstanceResponse_t *StartInstanceMarshal(adb_StartInstance_t * startIns
}

if (ccMeta.replyString != NULL) { // if replyString is set, we have a more detailed status/error message
snprintf(statusMessage, sizeof(statusMessage), ccMeta.replyString);
snprintf(statusMessage, sizeof(statusMessage), "%s", ccMeta.replyString);
EUCA_FREE(ccMeta.replyString); // the caller must free
}

Expand Down Expand Up @@ -2200,7 +2200,7 @@ adb_StopInstanceResponse_t *StopInstanceMarshal(adb_StopInstance_t * stopInstanc
}
}
if (ccMeta.replyString != NULL) { // if replyString is set, we have a more detailed status/error message
snprintf(statusMessage, sizeof(statusMessage), ccMeta.replyString);
snprintf(statusMessage, sizeof(statusMessage), "%s", ccMeta.replyString);
EUCA_FREE(ccMeta.replyString); // the caller must free
}

Expand Down
6 changes: 0 additions & 6 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,6 @@ if test $goodversion -eq 0; then
AC_MSG_ERROR([Eucalyptus needs at least JDK version $java_min_version])
fi

ant_version=`$ANT -version 2>&1 | grep "Ant.* version" | \
sed -e 's/.*Ant.* version \([[0-9.]]*\).*/\1/'`
goodversion=`expr $ant_version ">=" $ant_min_version`
if test $goodversion -eq 0; then
AC_MSG_ERROR([Eucalyptus needs at least ANT version $ant_min_version])
fi
# some version of ant picks up the wrong java
java_version=`JAVA_HOME=$JAVA_HOME $ANT -diagnostics 2>&1 | grep ^java.version | \
sed -e 's/java.* \([[0-9.]]*\).*/\1/'`
Expand Down
2 changes: 1 addition & 1 deletion net/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
include ../Makedefs

# Standard Libraries, Dependencies and Includes
STDLIBS := -lpthread -lm -lssl -lxml2 -lcurl -lcrypto -ljson -ljson-c
STDLIBS := -lpthread -lm -lssl -lxml2 -lcurl -lcrypto -ljson-c
STDDEPS := ../util/sequence_executor.o ../util/atomic_file.o ../util/log.o ../util/ipc.o ../util/misc.o
STDDEPS += ../util/euca_string.o ../util/euca_file.o ../util/hash.o ../util/fault.o ../util/wc.o ../util/utf8.o
STDDEPS += ../util/euca_auth.o ../storage/diskutil.o ../storage/http.o ../util/config.o ../util/euca_network.o
Expand Down
14 changes: 7 additions & 7 deletions net/ebt_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ int ebt_handler_init(ebt_handler *ebth, const char *cmdprefix) {
}

if (ebth->init) {
snprintf(sTempFilterFile, EUCA_MAX_PATH, ebth->ebt_filter_file);
snprintf(sTempNatFile, EUCA_MAX_PATH, ebth->ebt_nat_file);
snprintf(sTempAscFile, EUCA_MAX_PATH, ebth->ebt_asc_file);
snprintf(sTempFilterFile, EUCA_MAX_PATH, "%s", ebth->ebt_filter_file);
snprintf(sTempNatFile, EUCA_MAX_PATH, "%s", ebth->ebt_nat_file);
snprintf(sTempAscFile, EUCA_MAX_PATH, "%s", ebth->ebt_asc_file);

if (truncate_file(sTempFilterFile)) {
return (1);
Expand Down Expand Up @@ -209,9 +209,9 @@ int ebt_handler_init(ebt_handler *ebth, const char *cmdprefix) {
bzero(ebth, sizeof(ebt_handler));

// Copy names back into handler
snprintf(ebth->ebt_filter_file, EUCA_MAX_PATH, sTempFilterFile);
snprintf(ebth->ebt_nat_file, EUCA_MAX_PATH, sTempNatFile);
snprintf(ebth->ebt_asc_file, EUCA_MAX_PATH, sTempAscFile);
snprintf(ebth->ebt_filter_file, EUCA_MAX_PATH, "%s", sTempFilterFile);
snprintf(ebth->ebt_nat_file, EUCA_MAX_PATH, "%s", sTempNatFile);
snprintf(ebth->ebt_asc_file, EUCA_MAX_PATH, "%s", sTempAscFile);

if (cmdprefix) {
snprintf(ebth->cmdprefix, EUCA_MAX_PATH, "%s", cmdprefix);
Expand Down Expand Up @@ -473,7 +473,7 @@ int ebt_handler_add_table(ebt_handler *ebth, char *tablename) {
exit(1);
}
bzero(&(ebth->tables[ebth->max_tables]), sizeof(ebt_table));
snprintf(ebth->tables[ebth->max_tables].name, 64, tablename);
snprintf(ebth->tables[ebth->max_tables].name, 64, "%s", tablename);
ebth->max_tables++;
}

Expand Down
2 changes: 1 addition & 1 deletion net/euca-to-mido.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
#include <errno.h>
#include <ctype.h>
#include <curl/curl.h>
#include <json/json.h>
#include <json-c/json.h>

#include <eucalyptus.h>
#include <misc.h>
Expand Down
4 changes: 2 additions & 2 deletions net/euca_gni.c
Original file line number Diff line number Diff line change
Expand Up @@ -2244,7 +2244,7 @@ int gni_populate_gnidata(globalNetworkInfo *gni, xmlNodePtr xmlnode, xmlXPathCon
rc += evaluate_xpath_property(ctxptr, doc, xmlnode, expression, &results, &max_results);
for (i = 0; i < max_results; i++) {
LOGTRACE("after function: %d: %s\n", i, results[i]);
snprintf(gni->sMode, NETMODE_LEN, results[i]);
snprintf(gni->sMode, NETMODE_LEN, "%s", results[i]);
gni->nmCode = euca_netmode_atoi(gni->sMode);
EUCA_FREE(results[i]);
}
Expand Down Expand Up @@ -2824,7 +2824,7 @@ int gni_populate_interfaces(globalNetworkInfo *gni, gni_instance *instance, xmlN
//snprintf(gni->interfaces[gni->max_interfaces + i].instance_name.name, 1024, instance->name);
//gni_populate_instance_interface(&(gni->interfaces[gni->max_interfaces + i]), nodeset.nodeTab[i], ctxptr, doc);
gni->ifs[gni->max_ifs + i] = EUCA_ZALLOC_C(1, sizeof (gni_instance));
snprintf(gni->ifs[gni->max_ifs + i]->instance_name.name, 32, instance->name);
snprintf(gni->ifs[gni->max_ifs + i]->instance_name.name, 32, "%s", instance->name);
gni_populate_instance_interface(gni->ifs[gni->max_ifs + i], nodeset.nodeTab[i], ctxptr, doc);
instance->interfaces[i] = gni->ifs[gni->max_ifs + i];
//gni_instance_interface_print(gni->ifs[gni->max_ifs + i]), EUCA_LOG_INFO);
Expand Down
6 changes: 3 additions & 3 deletions net/ips_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ int ips_handler_init(ips_handler *ipsh, const char *cmdprefix) {
}

if (ipsh->init) {
snprintf(sTempFileName, EUCA_MAX_PATH, ipsh->ips_file);
snprintf(sTempFileName, EUCA_MAX_PATH, "%s", ipsh->ips_file);
if (truncate_file(sTempFileName)) {
return (1);
}
Expand All @@ -172,7 +172,7 @@ int ips_handler_init(ips_handler *ipsh, const char *cmdprefix) {

bzero(ipsh, sizeof(ips_handler));

snprintf(ipsh->ips_file, EUCA_MAX_PATH, sTempFileName);
snprintf(ipsh->ips_file, EUCA_MAX_PATH, "%s", sTempFileName);

if (cmdprefix) {
snprintf(ipsh->cmdprefix, EUCA_MAX_PATH, "%s", cmdprefix);
Expand Down Expand Up @@ -361,7 +361,7 @@ int ips_handler_add_set(ips_handler *ipsh, char *setname) {
exit(1);
}
bzero(&(ipsh->sets[ipsh->max_sets]), sizeof(ips_set));
snprintf(ipsh->sets[ipsh->max_sets].name, 64, setname);
snprintf(ipsh->sets[ipsh->max_sets].name, 64, "%s", setname);
ipsh->sets[ipsh->max_sets].ref_count = 1;
ipsh->max_sets++;
}
Expand Down
6 changes: 3 additions & 3 deletions net/ipt_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ int ipt_handler_init(ipt_handler *pIpt, const char *psCmdPrefix, const char *psP
//
// Copy filename out of the current ipt_handler struct.
//
snprintf(sTempFileName, EUCA_MAX_PATH, pIpt->ipt_file);
snprintf(sTempFileName, EUCA_MAX_PATH, "%s", pIpt->ipt_file);

// Truncate the file to ensure we're dealing with a clean slate.
if (truncate_file(sTempFileName)){
Expand Down Expand Up @@ -195,7 +195,7 @@ int ipt_handler_init(ipt_handler *pIpt, const char *psCmdPrefix, const char *psP
bzero(pIpt, sizeof(ipt_handler));

// Populate the temporary filename
snprintf(pIpt->ipt_file, EUCA_MAX_PATH, sTempFileName);
snprintf(pIpt->ipt_file, EUCA_MAX_PATH, "%s", sTempFileName);

// If we have a command prefix (like euca_rootwrap) set it
pIpt->cmdprefix[0] = '\0';
Expand Down Expand Up @@ -483,7 +483,7 @@ int ipt_handler_add_table(ipt_handler *ipth, char *tablename) {
exit(1);
}
bzero(&(ipth->tables[ipth->max_tables]), sizeof(ipt_table));
snprintf(ipth->tables[ipth->max_tables].name, 64, tablename);
snprintf(ipth->tables[ipth->max_tables].name, 64, "%s", tablename);
ipth->max_tables++;
}

Expand Down
2 changes: 1 addition & 1 deletion net/midonet-api.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
#include <dirent.h>
#include <errno.h>
#include <curl/curl.h>
#include <json/json.h>
#include <json-c/json.h>

#include <pthread.h>

Expand Down
2 changes: 1 addition & 1 deletion node/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ NET_LIB = ../net/libeucanet.a
NC_HANDLERS=handlers_xen.o handlers_kvm.o handlers_default.o xml.o hooks.o
STORAGE_OBJS=../storage/backing.o ../storage/diskutil.o ../storage/blobstore.o ../storage/objectstorage.o ../storage/vbr.o ../storage/iscsi.o ../storage/ebs_utils.o ../storage/sc-client-marshal-adb.o ../storage/storage-controller.o
STATS_OBJS = ../util/stats/stats.o ../util/stats/sensor_common.o ../util/stats/message_sensor.o ../util/stats/service_sensor.o ../util/stats/fs_emitter.o ../util/stats/message_stats.o
STATS_LIBS = -ljson -ljson-c -lm
STATS_LIBS = -ljson-c -lm
CFLAGS +=

BUILD_ID=-DEUCA_COMPILE_TIMESTAMP=\""[built `date --rfc-3339='sec'`]"\"
Expand Down
13 changes: 13 additions & 0 deletions node/handlers.c
Original file line number Diff line number Diff line change
Expand Up @@ -1304,6 +1304,18 @@ static void refresh_instance_info(struct nc_state_t *nc, ncInstance * instance)
}
}

// during reboot ensure that the domain enters reboot before setting instance back to Running
// and that we allow the instance to restart without detecting it as termination of the instance
if ((old_state == BOOTING) && (
((new_state == RUNNING) && (instance->bootTime > (time(NULL) - MONITORING_PERIOD))) ||
((new_state == SHUTOFF || new_state == SHUTDOWN) && (instance->bootTime > (time(NULL) - nc_state.reboot_grace_period_sec)))
)) {
if (new_state != RUNNING) { // skip logging for running as this happens frequently on reboot
LOGINFO("[%s] ignoring hypervisor reported state %s for booting domain during grace period (%d)\n",
instance->instanceId, instance_state_names[new_state], nc_state.reboot_grace_period_sec);
}
break;
}
if (new_state == SHUTOFF || new_state == SHUTDOWN || new_state == CRASHED) {
if (instance->terminationRequestedTime > (time(NULL) - nc_state.shutdown_grace_period_sec)) {
LOGINFO("[%s] ignoring hypervisor reported state %s for terminating domain during grace period (%d)\n",
Expand Down Expand Up @@ -2393,6 +2405,7 @@ static int init(void)
GET_VAR_INT(nc_state.sc_request_timeout_sec, CONFIG_SC_REQUEST_TIMEOUT, 45);
GET_VAR_INT(nc_state.concurrent_cleanup_ops, CONFIG_CONCURRENT_CLEANUP_OPS, 30);
GET_VAR_INT(nc_state.disable_snapshots, CONFIG_DISABLE_SNAPSHOTS, 0);
GET_VAR_INT(nc_state.reboot_grace_period_sec, CONFIG_NC_REBOOT_GRACE_PERIOD_SEC, 30);
GET_VAR_INT(nc_state.shutdown_grace_period_sec, CONFIG_SHUTDOWN_GRACE_PERIOD_SEC, 60);

strcpy(nc_state.admin_user_id, EUCALYPTUS_ADMIN);
Expand Down
1 change: 1 addition & 0 deletions node/handlers.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ struct nc_state_t {
int createImage_cleanup_threshold;
int teardown_state_duration;
int migration_ready_threshold;
int reboot_grace_period_sec;
int shutdown_grace_period_sec;
boolean migration_capable;
int ephemeral_cache_highwater_gb;
Expand Down
5 changes: 1 addition & 4 deletions rpm/eucalyptus.spec
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ Requires: lvm2
Requires: perl(Getopt::Long)
Requires: postgresql
Requires: postgresql-server
Requires: python-argparse
Requires: rsync

%description cloud
Expand Down Expand Up @@ -274,7 +273,6 @@ Requires: iproute
Requires: iptables
Requires: iputils
Requires: libselinux-python
Requires: python-argparse
Requires: rsync
Requires: /usr/bin/which
%{?systemd_requires}
Expand Down Expand Up @@ -307,7 +305,6 @@ Requires: eucalyptus-selinux > 0.2
Requires: eucanetd = %{version}-%{release}
Requires: httpd
Requires: iscsi-initiator-utils
Requires: kvm
# Ceph support requires librados2, librbd1, and *also* qemu-kvm-rhev.
Requires: librados2%{?_isa}
Requires: librbd1%{?_isa}
Expand All @@ -317,6 +314,7 @@ Requires: perl(Sys::Virt)
Requires: perl(Time::HiRes)
Requires: perl(XML::Simple)
Requires: qemu-kvm
Requires: qemu-system-x86
# The next six come from storage/diskutil.c, which shells out to lots of stuff.
Requires: coreutils
Requires: curl
Expand Down Expand Up @@ -399,7 +397,6 @@ Requires: %{name} = %{version}-%{release}
Requires: euca2ools >= 3.1
Requires: eucalyptus-selinux
Requires: pv
Requires: python-argparse
Requires: python-lxml
Requires: python-requests
# The next seven come from storage/diskutil.c, which shells
Expand Down
Loading

0 comments on commit fb3de89

Please sign in to comment.