summary refs log tree commit diff
path: root/synapse/state.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-08-15 11:47:01 +0100
committerErik Johnston <erik@matrix.org>2014-08-15 11:47:01 +0100
commitc5f2da587532c80cda066acc715344b74a9d19d5 (patch)
treece72c1d93bc829907fb726b15f6d8ef9ae74c1a1 /synapse/state.py
parentFix pontenial bug in state resolution handler that compared dicts rather than... (diff)
downloadsynapse-c5f2da587532c80cda066acc715344b74a9d19d5.tar.xz
Add a check to make sure that during state conflict res we only request a PDU we don't have.
Diffstat (limited to 'synapse/state.py')
-rw-r--r--synapse/state.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/synapse/state.py b/synapse/state.py
index d8977b61ea..4f8b4d9760 100644
--- a/synapse/state.py
+++ b/synapse/state.py
@@ -191,10 +191,18 @@ class StateHandler(object):
                 key=lambda x: x.depth
             )
 
+            pdu_id = missing_prev.prev_state_id
+            origin = missing_prev.prev_state_origin
+
+            is_missing = yield self.store.get_pdu(pdu_id, origin) is None
+
+            if not is_missing:
+                raise Exception("Conflict resolution failed.")
+
             yield self._replication.get_pdu(
                 destination=missing_prev.origin,
-                pdu_origin=missing_prev.prev_state_origin,
-                pdu_id=missing_prev.prev_state_id,
+                pdu_origin=origin,
+                pdu_id=pdu_id,
                 outlier=True
             )