Commit e85f0531 authored by Kirill Smelkov's avatar Kirill Smelkov

Merge branch '4-nxd' into 4-nxd--t

* 4-nxd:
  [ZEO4] Send invalidations even when empty
parents 6ac5dfab bf80d23d
...@@ -343,8 +343,7 @@ class ZEOStorage: ...@@ -343,8 +343,7 @@ class ZEOStorage:
self.storage.pack(time, referencesf) self.storage.pack(time, referencesf)
self.log("pack(time=%s) complete" % repr(time)) self.log("pack(time=%s) complete" % repr(time))
# Broadcast new size statistics # Broadcast new size statistics
self.server.invalidate(0, self.storage_id, None, self.server.invalidate(None, self.storage_id, info=self.get_size_info())
(), self.get_size_info())
def new_oids(self, n=100): def new_oids(self, n=100):
"""Return a sequence of n new oids, where n defaults to 100""" """Return a sequence of n new oids, where n defaults to 100"""
...@@ -414,8 +413,7 @@ class ZEOStorage: ...@@ -414,8 +413,7 @@ class ZEOStorage:
return Result(tid, self._clear_transaction) return Result(tid, self._clear_transaction)
def _invalidate(self, tid): def _invalidate(self, tid):
if self.invalidated: self.server.invalidate(self, self.storage_id, tid, self.invalidated)
self.server.invalidate(self, self.storage_id, tid, self.invalidated)
def tpc_abort(self, tid): def tpc_abort(self, tid):
if not self._check_tid(tid): if not self._check_tid(tid):
...@@ -1052,7 +1050,7 @@ class StorageServer: ...@@ -1052,7 +1050,7 @@ class StorageServer:
pass pass
def invalidate(self, conn, storage_id, tid, invalidated=(), info=None): def invalidate(self, conn, storage_id, tid=None, invalidated=None, info=None):
"""Internal: broadcast info and invalidations to clients. """Internal: broadcast info and invalidations to clients.
This is called from several ZEOStorage methods. This is called from several ZEOStorage methods.
...@@ -1098,15 +1096,18 @@ class StorageServer: ...@@ -1098,15 +1096,18 @@ class StorageServer:
# to cactch and ignore Disconnected errors. # to cactch and ignore Disconnected errors.
if invalidated: if invalidated is not None:
assert tid is not None
invq = self.invq[storage_id] invq = self.invq[storage_id]
if len(invq) >= self.invq_bound: if len(invq) >= self.invq_bound:
invq.pop() invq.pop()
invq.insert(0, (tid, invalidated)) invq.insert(0, (tid, invalidated))
else:
assert info is not None
for p in self.connections[storage_id]: for p in self.connections[storage_id]:
try: try:
if invalidated and p is not conn: if invalidated is not None and p is not conn:
p.client.invalidateTransaction(tid, invalidated) p.client.invalidateTransaction(tid, invalidated)
elif info is not None: elif info is not None:
p.client.info(info) p.client.info(info)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment