Bug
RuntimeLocalExternalPayloadStorage::put() returns its stable URI whenever the target file already exists, without checking its length/content or repairing a prior incomplete write. The retained-string path in RuntimeExternalPayloadRegistry::store() then marks that reference ready.
Reproduced on current main f471ef03: for a16-byte expected value and a7-byte preexisting partial file, put() returns the expected identity without error, while the stored hash is still wrong. The streaming upload path already checks and repairs an incomplete backing write, but the string path bypasses it.
Minimal reproduction with a disposable directory:
$driver = new RuntimeLocalExternalPayloadStorage($temporaryDirectory);
$data = 'complete-payload';
$hash = hash('sha256', $data);
$uri = $driver->uriFor($hash, 'avro');
$path = rawurldecode(parse_url($uri, PHP_URL_PATH));
mkdir(dirname($path), 0700, true);
file_put_contents($path, 'partial');
$driver->put($data, $hash, 'avro');
// Returns successfully, but hash_file('sha256', $path) !== $hash.
Scope And Acceptance
- Repair partial and equal-length corrupted local files on retained-string retries.
- Use one verified write/flush path for local string and streaming writes, without an additional payload-sized memory or staging-file copy.
- Preserve content-addressed URI identity and never truncate a correct previously accepted object on an idempotent retry.
- Add focused driver and registry-level regression coverage, including binary/empty values and failure/retry behavior.
- Publish the Server correction and qualify the affected behavior using the published artifact; assess downstream adoption explicitly. This is not a portable SDK/protocol change.
This is an existing Server defect, not a request for a new storage backend or replication protocol. No claim of observed host power-loss data loss is made by the partial-file reproduction.
Bug
RuntimeLocalExternalPayloadStorage::put()returns its stable URI whenever the target file already exists, without checking its length/content or repairing a prior incomplete write. The retained-string path inRuntimeExternalPayloadRegistry::store()then marks that reference ready.Reproduced on current main
f471ef03: for a16-byte expected value and a7-byte preexisting partial file,put()returns the expected identity without error, while the stored hash is still wrong. The streaming upload path already checks and repairs an incomplete backing write, but the string path bypasses it.Minimal reproduction with a disposable directory:
Scope And Acceptance
This is an existing Server defect, not a request for a new storage backend or replication protocol. No claim of observed host power-loss data loss is made by the partial-file reproduction.