backend/common/rhnLib.py |
10 ++
backend/satellite_tools/disk_dumper/dumper.py |
35 ++++------
backend/satellite_tools/syncCache.py |
15 ----
backend/spacewalk-backend.spec |
6 +
java/code/src/com/redhat/rhn/common/db/datasource/xml/Channel_queries.xml |
1
java/code/src/com/redhat/rhn/frontend/action/channel/ssm/ChildChannelConfirmAction.java |
11 ++-
java/code/src/com/redhat/rhn/frontend/events/SsmChangeChannelSubscriptionsAction.java |
21 ------
java/code/src/com/redhat/rhn/frontend/events/SsmChangeChannelSubscriptionsEvent.java |
26 +++++--
java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml |
3
rel-eng/packages/spacewalk-backend |
2
10 files changed, 67 insertions(+), 63 deletions(-)
New commits:
commit ff701044e4fed9679f0b568b65620b97bb01781e
Merge: 2af33f2... 88b2213...
Author: Partha Aji <paji(a)redhat.com>
Date: Thu May 27 16:58:44 2010 -0400
Merge branch 'master' into flex-guest
commit 88b2213a0f4674cef195dd31f4d420aba07c9dec
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu May 27 16:49:41 2010 +0200
Automatic commit of package [spacewalk-backend] release [1.1.16-1].
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec
index 5633e56..2be729f 100644
--- a/backend/spacewalk-backend.spec
+++ b/backend/spacewalk-backend.spec
@@ -8,7 +8,7 @@ Name: spacewalk-backend
Summary: Common programs needed to be installed on the Spacewalk servers/proxies
Group: Applications/Internet
License: GPLv2
-Version: 1.1.15
+Version: 1.1.16
Release: 1%{?dist}
URL:
https://fedorahosted.org/spacewalk
Source0:
https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -632,6 +632,10 @@ rm -f %{rhnconf}/rhnSecret.py*
# $Id$
%changelog
+* Thu May 27 2010 Michael Mraka <michael.mraka(a)redhat.com> 1.1.16-1
+- block old spacewalk from syncing sha256 channels via ISS
+- improved performance of linking packages during satellite-sync
+
* Wed May 19 2010 Michael Mraka <michael.mraka(a)redhat.com> 1.1.15-1
- 589299 - excluded checksum_list from headers
diff --git a/rel-eng/packages/spacewalk-backend b/rel-eng/packages/spacewalk-backend
index bb15411..18feab7 100644
--- a/rel-eng/packages/spacewalk-backend
+++ b/rel-eng/packages/spacewalk-backend
@@ -1 +1 @@
-1.1.15-1 backend/
+1.1.16-1 backend/
commit 3911fde5bbbc39aaec436caaca649767a69fa786
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu May 27 16:47:17 2010 +0200
removed local hash_object_id() and reused rhnLib.hash_object_id()
diff --git a/backend/satellite_tools/disk_dumper/dumper.py
b/backend/satellite_tools/disk_dumper/dumper.py
index 40d6dc0..61c915f 100644
--- a/backend/satellite_tools/disk_dumper/dumper.py
+++ b/backend/satellite_tools/disk_dumper/dumper.py
@@ -1328,7 +1328,7 @@ class ShortPackagesDumper(CachedDumper,
exportLib.ShortPackagesDumper):
def _get_key(self, params):
package_id = params['package_id']
- hash_val = hash_object_id(package_id, 100)
+ hash_val = rhnLib.hash_object_id(package_id, 2)
return "xml-short-packages/%s/rhn-package-short-%s.xml" % (
hash_val, package_id)
@@ -1382,7 +1382,7 @@ class PackagesDumper(CachedDumper, exportLib.PackagesDumper):
def _get_key(self, params):
package_id = params['package_id']
- hash_val = hash_object_id(package_id, 100)
+ hash_val = rhnLib.hash_object_id(package_id, 2)
return "xml-packages/%s/rhn-package-%s.xml" % (hash_val, package_id)
def _dump_subelement(self, data):
@@ -1420,7 +1420,7 @@ class SourcePackagesDumper(CachedDumper,
exportLib.SourcePackagesDumper):
def _get_key(self, params):
package_id = params['package_id']
- hash_val = hash_object_id(package_id, 100)
+ hash_val = rhnLib.hash_object_id(package_id, 2)
return "xml-packages/%s/rhn-source-package-%s.xml" % (hash_val,
package_id)
def _dump_subelement(self, data):
@@ -1454,7 +1454,7 @@ class ErrataDumper(CachedDumper, exportLib.ErrataDumper):
def _get_key(self, params):
errata_id = params['errata_id']
- hash_val = hash_object_id(errata_id, 10)
+ hash_val = rhnLib.hash_object_id(errata_id, 1)
return "xml-errata/%s/rhn-erratum-%s.xml" % (hash_val, errata_id)
def _dump_subelement(self, data):
@@ -1488,7 +1488,7 @@ class ErrataDumperEx(CachedDumper, exportLib.ErrataSynopsisDumper):
def _get_key(self, params):
errata_id = params['errata_id']
- hash_val = hash_object_id(errata_id, 10)
+ hash_val = rhnLib.hash_object_id(errata_id, 1)
return "xml-errata/%s/rhn-erratum-%s.xml" % (hash_val, errata_id)
def _dump_subelement(self, data):
@@ -1529,20 +1529,6 @@ class KickstartableTreesDumper(CachedDumper,
exportLib.KickstartableTreesDumper)
log_debug(6, data)
return exportLib.KickstartableTreesDumper.dump_subelement(self, data)
-def hash_object_id(obj_id, factor):
- """ This looks complicated; it returns the (integer part of)
- obj_id, modulo factor
- The string is left padded with as many 0 chars as necessary to
- match factor
- XXX This is copied from satellite_tools.diskImportLib.hashPackageID -
- should figure out a way to share it -- misa
- """
- # Make sure obj_id is a string
- obj_id = str(obj_id)
- format = int(math.ceil(math.log10(factor)))
- format = "%%0%sd" % format
- return format % (int(string.split(obj_id, '-')[-1]) % factor, )
-
class ClosedConnectionError(Exception):
pass
commit 4c3b684480245f9c6ec6001158c3cbde38243dd8
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu May 27 16:43:30 2010 +0200
BaseCache._hash_object_id() moved to rhnLib.hash_object_id()
diff --git a/backend/common/rhnLib.py b/backend/common/rhnLib.py
index 12c2704..0905f9b 100644
--- a/backend/common/rhnLib.py
+++ b/backend/common/rhnLib.py
@@ -172,3 +172,13 @@ def fix_url(url, scheme="http", path="/"):
_fragment))
return url
+def hash_object_id(self, object_id, factor):
+ """Given an object id (assumed to be <label>-<number>),
returns the
+ last few digits for the number. For instance, (812345, 3) should
+ return 345"""
+ # Grab the digits after -
+ num_id = string.split(object_id, '-')[-1]
+ # get last 'factor' numbers
+ num_id = num_id[-factor:]
+ return num_id.rjust(factor,'0')
+
diff --git a/backend/satellite_tools/syncCache.py b/backend/satellite_tools/syncCache.py
index c8662fb..c510a74 100644
--- a/backend/satellite_tools/syncCache.py
+++ b/backend/satellite_tools/syncCache.py
@@ -23,6 +23,7 @@ import string
# rhn imports:
from common import CFG, rhnCache
+from common.rhnLib import hash_object_id
# NOTE: this is a python 2.2-ism
__all__ = []
@@ -54,16 +55,6 @@ class BaseCache:
def _get_key(self, object_id):
raise NotImplementedError()
- def _hash_object_id(self, object_id, factor):
- """Given an object id (assumed to be
<label>-<number>), returns the
- last few digits for the number. For instance, (812345, 3) should
- return 345"""
- # Grab the digits after -
- num_id = string.split(object_id, '-')[-1]
- # get last 'factor' numbers
- num_id = num_id[-factor:]
- return num_id.rjust(factor,'0')
-
class ChannelCache(BaseCache):
def _get_key(self, object_id):
return os.path.join("satsync", "channels", str(object_id))
@@ -71,7 +62,7 @@ class ChannelCache(BaseCache):
class BasePackageCache(BaseCache):
_subdir = "__unknown__"
def _get_key(self, object_id):
- hash_val = self._hash_object_id(object_id, 2)
+ hash_val = hash_object_id(object_id, 2)
return os.path.join("satsync", self._subdir, hash_val, str(object_id))
class ShortPackageCache(BasePackageCache):
@@ -87,7 +78,7 @@ class SourcePackageCache(BasePackageCache):
class ErratumCache(BaseCache):
_subdir = "errata"
def _get_key(self, object_id):
- hash_val = self._hash_object_id(object_id, 1)
+ hash_val = hash_object_id(object_id, 1)
return os.path.join("satsync", self._subdir, hash_val, str(object_id))
class KickstartableTreesCache(BaseCache):
commit 0875be36d1fe6b81f7f86e19e99c073bdefb951a
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu May 27 15:52:26 2010 +0200
block old spacewalk / satellite from syncing sha256 channels via ISS
diff --git a/backend/satellite_tools/disk_dumper/dumper.py
b/backend/satellite_tools/disk_dumper/dumper.py
index 1a2d30d..40d6dc0 100644
--- a/backend/satellite_tools/disk_dumper/dumper.py
+++ b/backend/satellite_tools/disk_dumper/dumper.py
@@ -23,7 +23,7 @@ from types import ListType
from cStringIO import StringIO
from common import log_debug, log_error, rhnFault, UserDictCase, rhnCache, \
- CFG, rhnLib
+ CFG, rhnLib, rhnFlags
from server import rhnSQL, rhnDatabaseCache
from satellite_tools import constants
from satellite_tools.exporter import exportLib, xmlWriter
@@ -99,12 +99,15 @@ class XML_Dumper:
def get_channels_statement(self):
query = """
select c.id channel_id, c.label,
+ ct.label as checksum_type,
TO_CHAR(c.last_modified, 'YYYYMMDDHH24MISS') last_modified
from rhnChannel c, rhnChannelFamilyMembers cfm,
+ rhnChecksumType ct,
(%s
) scf
where scf.channel_family_id = cfm.channel_family_id
and cfm.channel_id = c.id
+ and c.checksum_type_id = ct.id(+)
""" % self._channel_family_query
return DatabaseStatement().set_statement(rhnSQL.prepare(query))
@@ -469,6 +472,8 @@ class XML_Dumper:
all_channels_hash[row['label']] = row
# Intersect the list of channels they've sent to us
+ iss_slave_sha256_capable =
(float(rhnFlags.get('X-RHN-Satellite-XML-Dump-Version')) >=
constants.SHA256_SUPPORTED_VERSION)
+
if not channel_labels:
channels = all_channels_hash
else:
@@ -477,6 +482,10 @@ class XML_Dumper:
if not all_channels_hash.has_key(label):
raise rhnFault(3001, "Could not retrieve channel %s" %
label)
+ if not (iss_slave_sha256_capable
+ or all_channels_hash[label]['checksum_type'] in [None,
'sha1']):
+ raise rhnFault(3001, "Channel %s has incompatible checksum
(%)" %
+ (label, all_channels_hash[label]['checksum_type']))
channels[label] = all_channels_hash[label]
return channels
commit 09b0052b46bf78853cdf7fd8900b43a76a588fcb
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Wed May 26 15:14:02 2010 -0400
595473 525588 - fixing small query issue and moving the ssm operation creation to
before the
diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Channel_queries.xml
b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Channel_queries.xml
index 9f85343..00cf97e 100644
--- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Channel_queries.xml
+++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Channel_queries.xml
@@ -1196,6 +1196,7 @@ GROUP BY C.id, C.name
where
rset.label = :set_label and
rset.user_id = :uid and
+ rset.element = S.id and
C.parent_channel = SC.channel_id and
SCAC.server_arch_id = S.server_arch_id and
SCAC.channel_arch_id = C.channel_arch_id and
diff --git
a/java/code/src/com/redhat/rhn/frontend/action/channel/ssm/ChildChannelConfirmAction.java
b/java/code/src/com/redhat/rhn/frontend/action/channel/ssm/ChildChannelConfirmAction.java
index edbdcfa..9056fd0 100644
---
a/java/code/src/com/redhat/rhn/frontend/action/channel/ssm/ChildChannelConfirmAction.java
+++
b/java/code/src/com/redhat/rhn/frontend/action/channel/ssm/ChildChannelConfirmAction.java
@@ -28,6 +28,7 @@ import com.redhat.rhn.frontend.taglibs.list.helper.Listable;
import com.redhat.rhn.manager.channel.ChannelManager;
import com.redhat.rhn.manager.rhnset.RhnSetDecl;
import com.redhat.rhn.manager.ssm.SsmManager;
+import com.redhat.rhn.manager.ssm.SsmOperationManager;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -97,9 +98,17 @@ public class ChildChannelConfirmAction extends RhnAction implements
Listable {
ActionForward result;
if (isSubmitted(daForm)) {
+ long operationId = SsmOperationManager.createOperation(user,
+ "Channel Subscription Updates", null);
+
+ SsmOperationManager.associateServersWithOperation(operationId, user.getId(),
+ RhnSetDecl.SSM_CHANNEL_SUBSCRIBE.getLabel());
+ SsmOperationManager.associateServersWithOperation(operationId, user.getId(),
+ RhnSetDecl.SSM_CHANNEL_UNSUBSCRIBE.getLabel());
+
// Fire the request off asynchronously
SsmChangeChannelSubscriptionsEvent event =
- new SsmChangeChannelSubscriptionsEvent(user, subs.values());
+ new SsmChangeChannelSubscriptionsEvent(user, subs.values(),
operationId);
MessageQueue.publish(event);
result = mapping.findForward("success");
diff --git
a/java/code/src/com/redhat/rhn/frontend/events/SsmChangeChannelSubscriptionsAction.java
b/java/code/src/com/redhat/rhn/frontend/events/SsmChangeChannelSubscriptionsAction.java
index 979a05b..cd3341b 100644
---
a/java/code/src/com/redhat/rhn/frontend/events/SsmChangeChannelSubscriptionsAction.java
+++
b/java/code/src/com/redhat/rhn/frontend/events/SsmChangeChannelSubscriptionsAction.java
@@ -17,7 +17,6 @@ package com.redhat.rhn.frontend.events;
import com.redhat.rhn.common.messaging.EventMessage;
import com.redhat.rhn.domain.user.User;
import com.redhat.rhn.frontend.action.channel.ssm.ChannelActionDAO;
-import com.redhat.rhn.manager.rhnset.RhnSetDecl;
import com.redhat.rhn.manager.ssm.SsmManager;
import com.redhat.rhn.manager.ssm.SsmOperationManager;
@@ -38,24 +37,6 @@ public class SsmChangeChannelSubscriptionsAction extends
AbstractDatabaseAction
User user = event.getUser();
Collection<ChannelActionDAO> changes = event.getChanges();
- // Parse and store the changes into RhnSets
- SsmManager.populateSsmChannelServerSets(user, changes);
-
- // Log the change operation
-
- /* Since the servers are in two separate sets, make explicit associations from
- those sets to the operation.
- */
- long operationId = SsmOperationManager.createOperation(user,
- "Channel Subscription Updates", null);
-
- SsmOperationManager.associateServersWithOperation(operationId, user.getId(),
- RhnSetDecl.SSM_CHANNEL_SUBSCRIBE.getLabel());
- SsmOperationManager.associateServersWithOperation(operationId, user.getId(),
- RhnSetDecl.SSM_CHANNEL_UNSUBSCRIBE.getLabel());
-
- // Do the changes
-
/* Anything after the operation is created should be in a try..finally to
attempt to prevent a hanging, perpetually in progress operation. This is
an added safety once a taskomatic task is created to automatically time out
@@ -66,7 +47,7 @@ public class SsmChangeChannelSubscriptionsAction extends
AbstractDatabaseAction
}
finally {
// Complete the action
- SsmOperationManager.completeOperation(user, operationId);
+ SsmOperationManager.completeOperation(user, event.getOpId());
}
}
}
diff --git
a/java/code/src/com/redhat/rhn/frontend/events/SsmChangeChannelSubscriptionsEvent.java
b/java/code/src/com/redhat/rhn/frontend/events/SsmChangeChannelSubscriptionsEvent.java
index 34e64c9..3076dd5 100644
---
a/java/code/src/com/redhat/rhn/frontend/events/SsmChangeChannelSubscriptionsEvent.java
+++
b/java/code/src/com/redhat/rhn/frontend/events/SsmChangeChannelSubscriptionsEvent.java
@@ -21,26 +21,28 @@ import com.redhat.rhn.frontend.action.channel.ssm.ChannelActionDAO;
import java.util.Collection;
/**
- * Event fired to carry the information necessary to perform subscription changes
- * for servers in the SSM.
+ * Event fired to carry the information necessary to perform subscription
+ * changes for servers in the SSM.
*
- * @see com.redhat.rhn.frontend.events.SsmChangeChannelSubscriptionsAction
+ * @see com.redhat.rhn.frontend.events.SsmChangeChannelSubscriptionsAction
* @version $Revision$
*/
public class SsmChangeChannelSubscriptionsEvent implements EventMessage {
private User user;
private Collection<ChannelActionDAO> changes;
+ private Long opId;
/**
* Creates a new SSM channel change event to fire across the message bus.
*
- * @param userIn user making the changes; cannot be <code>null</code>
+ * @param userIn user making the changes; cannot be <code>null</code>
* @param changesIn changes to make; cannot be <code>null</code>
+ * @param operationId the operation id
*/
public SsmChangeChannelSubscriptionsEvent(User userIn,
- Collection<ChannelActionDAO>
changesIn) {
-
+ Collection<ChannelActionDAO> changesIn, Long operationId) {
+
if (userIn == null) {
throw new IllegalArgumentException("user cannot be null");
}
@@ -48,9 +50,10 @@ public class SsmChangeChannelSubscriptionsEvent implements EventMessage
{
if (changesIn == null) {
throw new IllegalArgumentException("changes cannot be null");
}
-
+
this.user = userIn;
this.changes = changesIn;
+ this.opId = operationId;
}
/**
@@ -67,6 +70,13 @@ public class SsmChangeChannelSubscriptionsEvent implements EventMessage
{
return changes;
}
+ /**
+ * @return the op id
+ */
+ public Long getOpId() {
+ return opId;
+ }
+
/** {@inheritDoc} */
public String toText() {
return toString();
@@ -75,6 +85,6 @@ public class SsmChangeChannelSubscriptionsEvent implements EventMessage
{
/** {@inheritDoc} */
public String toString() {
return "SsmChannelSubscriptionsEvent[User: " + user.getLogin() +
- ", Change Count: " + changes.size() + "]";
+ ", Change Count: " + changes.size() + "]";
}
}
diff --git a/java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml
b/java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml
index 9b1bea6..3ca1797 100644
--- a/java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml
+++ b/java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml
@@ -8492,6 +8492,9 @@ Follow this url to see the full list of inactive systems:
<trans-unit id="error.config.revnum.invalid">
<source>Please specify a valid revision number.</source>
</trans-unit>
+ <trans-unit id="ssm.subscription.operation.label">
+ <source>Channel Subscription Updates</source>
+ </trans-unit>
<trans-unit id="kickstart.cobbler.distro.syncfail">
<source>
The following is a list of errors gathered while Spacewalk attempts to