|
|
|
|
@ -197,7 +197,7 @@ $artifactId = Capsule::table('cloud_storage_artifacts')->insertGetId([
|
|
|
|
|
'sha256' => str_repeat('e', 64),
|
|
|
|
|
'durability_policy' => 'mirror_required_2',
|
|
|
|
|
'desired_copies' => 2, 'required_copies' => 2,
|
|
|
|
|
'state' => 'protected', 'last_operation_id' => str_repeat('1', 32),
|
|
|
|
|
'state' => 'available', 'last_operation_id' => str_repeat('1', 32),
|
|
|
|
|
'verified_at' => $now, 'created_at' => $now, 'updated_at' => $now,
|
|
|
|
|
]);
|
|
|
|
|
$primaryReplicaId = Capsule::table('cloud_storage_replicas')->insertGetId([
|
|
|
|
|
@ -250,9 +250,9 @@ Capsule::table('cloud_storage_operations')->insert([
|
|
|
|
|
Capsule::table('cloud_storage_publications')->insert([
|
|
|
|
|
'publication_key' => str_repeat('8', 32), 'artifact_id' => $artifactId,
|
|
|
|
|
'template_import_intent_id' => str_repeat('9', 32),
|
|
|
|
|
'state' => 'completed', 'attempts' => 1, 'available_at' => 0,
|
|
|
|
|
'state' => 'waiting_protection', 'attempts' => 1, 'available_at' => 0,
|
|
|
|
|
'lease_until' => 0, 'last_error_code' => '',
|
|
|
|
|
'coverage_ready_at' => $now, 'finalized_at' => $now,
|
|
|
|
|
'coverage_ready_at' => null, 'finalized_at' => null,
|
|
|
|
|
'created_at' => $now, 'updated_at' => $now,
|
|
|
|
|
]);
|
|
|
|
|
Capsule::table('cloud_storage_backends')->where('id', 2)->update([
|
|
|
|
|
@ -262,7 +262,8 @@ Capsule::table('cloud_storage_backends')->where('id', 2)->update([
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$assert($repair->tick($now + 3),
|
|
|
|
|
'Replacement backend did not repair unreachable required-two coverage.');
|
|
|
|
|
'Replacement backend did not repair required-two coverage while the '
|
|
|
|
|
. 'owner publication was still waiting for protection.');
|
|
|
|
|
$replacement = CloudStorageReplica::where('artifact_id', $artifactId)
|
|
|
|
|
->where('state', 'reserved')->firstOrFail();
|
|
|
|
|
$assert((int) $replacement->backend_id === 4
|
|
|
|
|
|