|
|
|
|
@ -186,9 +186,9 @@ CloudStorageArtifact::whereKey($view['artifact_id'])->update([
|
|
|
|
|
'desired_copies' => 1,
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
// A failed old replica must not occupy durability coverage. For a required-two
|
|
|
|
|
// artifact, replacement also must use a failure domain distinct from the only
|
|
|
|
|
// exact ready source.
|
|
|
|
|
// A healthy replica on a draining backend must not occupy forward durability
|
|
|
|
|
// coverage. This lets maintenance evacuate to a replacement before the old
|
|
|
|
|
// provider is taken offline. Required-two still needs a distinct domain.
|
|
|
|
|
$insertBackend(3, 'active', 'healthy', 1, 'provider-a', 1, 'same-domain');
|
|
|
|
|
$insertBackend(4, 'active', 'healthy', 1, 'provider-c', 50, 'replacement');
|
|
|
|
|
$artifactId = Capsule::table('cloud_storage_artifacts')->insertGetId([
|
|
|
|
|
@ -256,8 +256,8 @@ Capsule::table('cloud_storage_publications')->insert([
|
|
|
|
|
'created_at' => $now, 'updated_at' => $now,
|
|
|
|
|
]);
|
|
|
|
|
Capsule::table('cloud_storage_backends')->where('id', 2)->update([
|
|
|
|
|
'admin_state' => 'read_only', 'health_state' => 'unreachable',
|
|
|
|
|
'tested_revision' => 0, 'last_error_code' => 'endpoint_unreachable',
|
|
|
|
|
'admin_state' => 'draining', 'health_state' => 'healthy',
|
|
|
|
|
'tested_revision' => 1, 'last_error_code' => '',
|
|
|
|
|
'updated_at' => $now,
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
@ -270,7 +270,7 @@ $assert((int) $replacement->backend_id === 4
|
|
|
|
|
&& (string) $replacement->object_key
|
|
|
|
|
=== 'replacement/templates/image.qcow2'
|
|
|
|
|
&& CloudStorageReplica::where('artifact_id', $artifactId)->count() === 3,
|
|
|
|
|
'Repair counted degraded evidence or selected the source failure domain.');
|
|
|
|
|
'Repair counted draining evidence or selected an existing failure domain.');
|
|
|
|
|
|
|
|
|
|
$workerSource = file_get_contents(dirname(__DIR__)
|
|
|
|
|
. '/app/Services/Cloud/CloudStorageReplicaWorkerService.php');
|
|
|
|
|
|