patroni.scripts.wale_restore module¶
-
class
patroni.scripts.wale_restore.ExitCode¶ Bases:
enum.IntEnumAn enumeration.
-
FAIL= 2¶ Don’t try again unless configuration changes
-
RETRY_LATER= 1¶ External issue, retry later
-
SUCCESS= 0¶ Succeeded
-
-
class
patroni.scripts.wale_restore.WALEConfig(env_dir, threshold_mb, threshold_pct, cmd)¶ Bases:
tuple-
_asdict()¶ Return a new dict which maps field names to their values.
-
_field_defaults= {}¶
-
_field_types= {'cmd': typing.List[str], 'env_dir': <class 'str'>, 'threshold_mb': <class 'int'>, 'threshold_pct': <class 'int'>}¶
-
_fields= ('env_dir', 'threshold_mb', 'threshold_pct', 'cmd')¶
-
_fields_defaults= {}¶
-
classmethod
_make(iterable)¶ Make a new WALEConfig object from a sequence or iterable
-
_replace(**kwds)¶ Return a new WALEConfig object replacing specified fields with new values
-
cmd¶ Alias for field number 3
-
env_dir¶ Alias for field number 0
-
threshold_mb¶ Alias for field number 1
-
threshold_pct¶ Alias for field number 2
-
-
class
patroni.scripts.wale_restore.WALERestore(scope: str, datadir: str, connstring: str, env_dir: str, threshold_mb: int, threshold_pct: int, use_iam: int, no_leader: bool, retries: int)¶ Bases:
object-
__init__(scope: str, datadir: str, connstring: str, env_dir: str, threshold_mb: int, threshold_pct: int, use_iam: int, no_leader: bool, retries: int) → None¶ Initialize self. See help(type(self)) for accurate signature.
-
create_replica_with_s3() → int¶
-
fix_subdirectory_path_if_broken(dirname: str) → bool¶
-
run() → int¶ Creates a new replica using WAL-E
Returns: 0 = Success 1 = Error, try again 2 = Error, don’t try again Return type: ExitCode
-
should_use_s3_to_create_replica() → Optional[bool]¶ determine whether it makes sense to use S3 and not pg_basebackup
-
-
patroni.scripts.wale_restore.get_major_version(data_dir: str) → float¶
-
patroni.scripts.wale_restore.main() → int¶
-
patroni.scripts.wale_restore.repr_size(n_bytes: float) → str¶ >>> repr_size(1000) '1000 Bytes' >>> repr_size(8257332324597) '7.5 TiB'
-
patroni.scripts.wale_restore.size_as_bytes(size: float, prefix: str) → int¶ >>> size_as_bytes(7.5, 'T') 8246337208320