| OLD | NEW |
| 1 # Copyright 2014 The LUCI Authors. All rights reserved. | 1 # Copyright 2014 The LUCI Authors. All rights reserved. |
| 2 # Use of this source code is governed by the Apache v2.0 license that can be | 2 # Use of this source code is governed under the Apache License, Version 2.0 |
| 3 # found in the LICENSE file. | 3 # that can be found in the LICENSE file. |
| 4 | 4 |
| 5 """Replica side of Primary <-> Replica protocol. | 5 """Replica side of Primary <-> Replica protocol. |
| 6 | 6 |
| 7 Also includes common code used by both Replica and Primary. | 7 Also includes common code used by both Replica and Primary. |
| 8 """ | 8 """ |
| 9 | 9 |
| 10 import collections | 10 import collections |
| 11 import hashlib | 11 import hashlib |
| 12 | 12 |
| 13 from google.appengine.api import app_identity | 13 from google.appengine.api import app_identity |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 # Update was successfully applied. | 408 # Update was successfully applied. |
| 409 if applied: | 409 if applied: |
| 410 return True, current_state | 410 return True, current_state |
| 411 | 411 |
| 412 # Some other task managed to apply the update already. | 412 # Some other task managed to apply the update already. |
| 413 if current_state.auth_db_rev >= revision.auth_db_rev: | 413 if current_state.auth_db_rev >= revision.auth_db_rev: |
| 414 return False, current_state | 414 return False, current_state |
| 415 | 415 |
| 416 # Need to retry. Try until success or deadline. | 416 # Need to retry. Try until success or deadline. |
| 417 assert current_state.auth_db_rev < revision.auth_db_rev | 417 assert current_state.auth_db_rev < revision.auth_db_rev |
| OLD | NEW |