Skip to content

Commit

Permalink
debug update state
Browse files Browse the repository at this point in the history
  • Loading branch information
Leonid Chernin committed Dec 25, 2024
1 parent e2bc8d8 commit c23fe50
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions control/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ def _add_key(self, key: str, val: str):
(str(version_update),))
self.ioctx.operate_write_op(write_op, self.omap_name)
self.version = version_update
self.logger.debug(f"omap_key generated: {key}")
self.logger.info(f"omap_key generated: {key}, OMAP version: {version_update}")
except Exception:
self.logger.exception(f"Unable to add key to OMAP, exiting!")
raise
Expand Down Expand Up @@ -912,8 +912,9 @@ def update(self) -> bool:
omap_version = int(omap_state_dict[self.omap.OMAP_VERSION_KEY])
local_version = self.omap.get_local_version()

self.logger.info(f"Check local version {local_version} against OMAP version {omap_version}")
if local_version < omap_version:
self.logger.debug(f"Start update from {local_version} to {omap_version} ({self.id_text}).")
self.logger.info(f"Start update from {local_version} to {omap_version} ({self.id_text}).")
local_state_dict = self.local.get_state()
local_state_keys = local_state_dict.keys()
omap_state_keys = omap_state_dict.keys()
Expand Down Expand Up @@ -1055,7 +1056,7 @@ def update(self) -> bool:
# Update local state and version
self.local.reset(omap_state_dict)
self.omap.set_local_version(omap_version)
self.logger.debug(f"Update complete ({local_version} -> {omap_version}) ({self.id_text}).")
self.logger.info(f"Update complete ({local_version} -> {omap_version}) ({self.id_text}).")

return True

Expand Down

0 comments on commit c23fe50

Please sign in to comment.