pacemaker/crm_history_5_c3068d22de72.patch
Tim Serong 0440703030 - Upgrade to 1.1.6.
- PE: Demote from Master does not clear previous errors
- crmd: Prevent secondary DC fencing resulting from CIB updates
  that are lost due to elections
- crmd: Log duplicate DC detection as a WARNING not ERROR
- crmd: Bug lf#2632 - Correctly handle nodes that return faster
  than stonith
- Core: Treat GNUTLS_E_UNEXPECTED_PACKET_LENGTH as normal
  termination of a TLS session
- cib: Call gnutls_bye() and shutdown() when disconnecting from
  remote TLS connections
- cib: Remove disconnected remote connections from mainloop
- cib: Attempt a graceful sign-off for remote TLS connections
- Core: Ensure there is sufficient space for EOS when building
  short-form option strings (prevents segfault)
- Core: Fix variable expansion in pkg-config files
- PE: Resolve memory leak reported by valgrind
- PE: Fix memory leak for re-allocated resources reported by
  valgrind
- PE: Improve the merging with template's operations
- crmd: Allow nodes to fence themselves if they're the last one
  standing (lf#2584)
- stonith: Add an API call for listing installed agents
- stonith: Allow the fencing history to be queried
- stonith: Ensure completed operations are recorded as such in
  the history
- stonith: Support --quiet to display just the seconds since
  epoch at which a node was last shot
- stonith: Serialize actions for a given device
- stonith: Add missing entries to stonith_error2string() (missing

OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/pacemaker?expand=0&rev=18
2011-09-20 14:36:23 +00:00

91 lines
3.0 KiB
Diff

# HG changeset patch
# User Dejan Muhamedagic <dejan@hello-penguin.com>
# Date 1313019300 -7200
# Node ID c3068d22de72d1ba616d43c808091bef830eb9f6
# Parent b3a014c0f85b2bbe1e6a2360c44fbbfc7ac27b73
Medium: Shell: improve capture log slices for transitions (bnc#710907)
diff --git a/shell/modules/report.py b/shell/modules/report.py
--- a/shell/modules/report.py
+++ b/shell/modules/report.py
@@ -65,7 +65,25 @@ def syslog_ts(s):
common_warn("malformed line: %s" % s)
return None
-def log_seek(f, ts, endpos = False):
+def seek_to_edge(f, ts, to_end):
+ '''
+ f contains lines with exactly the timestamp ts.
+ Read forward (or backward) till we find the edge.
+ Linear search, but should be short.
+ '''
+ if not to_end:
+ while ts == get_timestamp(f):
+ f.seek(-1000, 1) # go back 10 or so lines
+ while True:
+ pos = f.tell()
+ s = f.readline()
+ curr_ts = syslog_ts(s)
+ if (to_end and curr_ts > ts) or \
+ (not to_end and curr_ts >= ts):
+ break
+ f.seek(pos)
+
+def log_seek(f, ts, to_end = False):
'''
f is an open log. Do binary search for the timestamp.
Return the position of the (more or less) first line with a
@@ -75,10 +93,11 @@ def log_seek(f, ts, endpos = False):
f.seek(0,2)
last = f.tell()
if not ts:
- return endpos and last or first
+ return to_end and last or first
badline = 0
maxbadline = 10
- common_debug("seek ts %s" % time.ctime(ts))
+ common_debug("seek %s:%s in %s" %
+ (time.ctime(ts), to_end and "end" or "start", f.name))
while first <= last:
# we can skip some iterations if it's about few lines
if abs(first-last) < 120:
@@ -98,9 +117,12 @@ def log_seek(f, ts, endpos = False):
elif log_ts < ts:
first = mid+1
else:
+ seek_to_edge(f, log_ts, to_end)
break
- common_debug("sought to %s" % time.ctime(log_ts))
- return f.tell()
+ fpos = f.tell()
+ common_debug("sought to %s (%d)" % (f.readline(), fpos))
+ f.seek(fpos)
+ return fpos
def get_timestamp(f):
'''
@@ -187,7 +209,7 @@ class LogSyslog(object):
for log in self.f:
f = self.f[log]
start = log_seek(f, self.from_ts)
- end = log_seek(f, self.to_ts, endpos = True)
+ end = log_seek(f, self.to_ts, to_end = True)
if start == -1 or end == -1:
bad_logs.append(log)
else:
diff --git a/shell/modules/utils.py b/shell/modules/utils.py
--- a/shell/modules/utils.py
+++ b/shell/modules/utils.py
@@ -413,7 +413,10 @@ def run_ptest(graph_s, nograph, scores,
print get_stdout(ptest, input_s = graph_s)
#page_string(get_stdout(ptest, input_s = graph_s))
if dotfile:
- show_dot_graph(dotfile)
+ if os.path.getsize(dotfile) > 0:
+ show_dot_graph(dotfile)
+ else:
+ common_warn("ptest produced empty dot file")
vars.tmpfiles.append(dotfile)
else:
if not nograph: