Files
aevolution/include/evo/persistence/population_interval_store.hpp
dingo 0a8962b57e
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 2m28s
Foundation / checks (tsan) (push) Failing after 18m22s
Foundation / checks (network) (push) Successful in 20m38s
Foundation / checks (client) (push) Failing after 21m6s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (postgres) (push) Canceled after 46m54s
Foundation / checks (checks) (push) Canceled after 47m3s
M12.4: retain and settle owned population intervals
2026-10-17 17:31:05 -04:00

22 lines
992 B
C++

#pragma once
#include "evo/persistence/region_lease_store.hpp"
namespace evo::persistence {
// ADR-0143 / schema 45. Exactly one pending bounded interval, identified by its
// immutable source head. A new holder may finish it; admission grants no lease.
struct PopulationInterval {
Uuid source_commit{};
Sha256Digest source_manifest_sha256{};
std::uint64_t begin_tick{}, end_tick{};
std::uint32_t controller_version{1};
bool operator==(const PopulationInterval&) const = default;
};
[[nodiscard]] std::expected<PopulationInterval, LeaseStoreFailure>
admit_population_interval(Postgres&, RegionKey, const LeaseGrant&, const RegionHead& source,
std::uint64_t end_tick, std::chrono::milliseconds timeout);
[[nodiscard]] std::expected<std::optional<PopulationInterval>, LeaseStoreFailure>
load_population_interval(Postgres&, RegionKey, const LeaseGrant&,
std::chrono::milliseconds timeout);
} // namespace evo::persistence