Complete M7.9b upgrade barrier and durability qualification
Schema v8 binds authority to builds (ADR-0068): acquisition names the host build and only retained, unretired builds may hold a lease; no commit may name a retired build; upgrade_barrier retires a build and fences every holder in one transaction, while build-less pre-v8 hosts keep working until the first barrier. Tests cover a writer surviving a failed and then a real online migration, old-writer fencing on every path, whole-history recovery by the new build, and the M7 qualification fixture (19.6 s SIGKILL-to-ready under the production lease, no lost acknowledgements). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Vendored
+11
-1
@@ -46,7 +46,7 @@ inline std::unique_ptr<persistence::Postgres> owner() {
|
||||
inline std::string request_hex(std::uint64_t tick, std::uint8_t tag = 0x9B) {
|
||||
char out[33];
|
||||
std::snprintf(out, sizeof out, "%02x000000000000000000000000%06llx", tag,
|
||||
static_cast<unsigned long long>(tick));
|
||||
static_cast<unsigned long long>(tick & 0xFFFFFFU)); // Test ticks < 2^24.
|
||||
return out;
|
||||
}
|
||||
inline std::string input_line(std::uint64_t tick, bool consumer_dies, std::uint8_t tag = 0x9B) {
|
||||
@@ -150,6 +150,14 @@ class Child {
|
||||
[[nodiscard]] const std::vector<std::string>& lines() const noexcept {
|
||||
return lines_;
|
||||
}
|
||||
// Arrival time of each line (when it was read), for latency measurement.
|
||||
[[nodiscard]] const std::vector<Clock::time_point>& times() const noexcept {
|
||||
return times_;
|
||||
}
|
||||
// Reads whatever arrives for `duration`, stamping each line.
|
||||
void pump(std::chrono::milliseconds duration) {
|
||||
wait_for([](const std::string&) { return false; }, duration);
|
||||
}
|
||||
[[nodiscard]] bool printed(std::string_view prefix) const {
|
||||
for (const auto& l : lines_)
|
||||
if (starts(l, prefix))
|
||||
@@ -169,6 +177,7 @@ class Child {
|
||||
buffer_.append(chunk, static_cast<std::size_t>(n));
|
||||
for (auto end = buffer_.find('\n'); end != std::string::npos; end = buffer_.find('\n')) {
|
||||
lines_.push_back(buffer_.substr(0, end));
|
||||
times_.push_back(Clock::now());
|
||||
buffer_.erase(0, end + 1);
|
||||
}
|
||||
return true;
|
||||
@@ -177,6 +186,7 @@ class Child {
|
||||
int in_{-1}, out_{-1};
|
||||
std::string buffer_;
|
||||
std::vector<std::string> lines_;
|
||||
std::vector<Clock::time_point> times_;
|
||||
};
|
||||
|
||||
struct ServerRegion {
|
||||
|
||||
Reference in New Issue
Block a user