| 253 | { |
| 254 | |
| 255 | void assertDigest( |
| 256 | const KeeperDigest & expected, |
| 257 | const KeeperDigest & actual, |
| 258 | const Coordination::ZooKeeperRequest & request, |
| 259 | uint64_t log_idx, |
| 260 | uint64_t session_id, |
| 261 | bool committing) |
| 262 | { |
| 263 | if (!KeeperStorageBase::checkDigest(expected, actual)) |
| 264 | { |
| 265 | LOG_FATAL( |
| 266 | getLogger("KeeperStateMachine"), |
| 267 | "Digest for nodes is not matching after {} request of type '{}' at log index {} for session {}.\nExpected digest - {}, actual digest - {} " |
| 268 | "(digest {}). Keeper will terminate to avoid inconsistencies.\nExtra information about the request:\n{}", |
| 269 | committing ? "committing" : "preprocessing", |
| 270 | request.getOpNum(), |
| 271 | log_idx, |
| 272 | session_id, |
| 273 | expected.value, |
| 274 | actual.value, |
| 275 | expected.version, |
| 276 | request.toString()); |
| 277 | std::terminate(); |
| 278 | } |
| 279 | } |
| 280 | |
| 281 | /// Macros to construct timed lock guards for state_machine_storage_mutex with appropriate ProfileEvents. |
| 282 | /// We cannot use a factory function because TSA does not track lock ownership across function boundaries. |
no test coverage detected