Skip to content

Commit 8717953

Browse files
committed
added diag
1 parent 79b64a7 commit 8717953

3 files changed

Lines changed: 34 additions & 6 deletions

File tree

crates/fula-cli/src/handlers/object.rs

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -808,11 +808,23 @@ pub async fn copy_object(
808808
/// RFC 7232 §3.1. True iff the If-Match precondition is satisfied.
809809
pub(crate) fn match_if_match(header: &str, current: Option<&str>) -> bool {
810810
let h = header.trim();
811-
if h == "*" {
812-
return current.is_some();
813-
}
814-
let Some(cur) = current else { return false; };
815-
parse_etag_list(h).any(|t| t == cur)
811+
let result = if h == "*" {
812+
current.is_some()
813+
} else {
814+
match current {
815+
Some(cur) => parse_etag_list(h).any(|t| t == cur),
816+
None => false,
817+
}
818+
};
819+
// TEMPORARY DIAGNOSTIC for #29 — emits exactly what's compared on every
820+
// If-Match check. Remove once duplicate-bucket / 412-loop is closed.
821+
tracing::warn!(
822+
if_match = %h,
823+
current = ?current,
824+
result,
825+
"match_if_match diag"
826+
);
827+
result
816828
}
817829

818830
/// RFC 7232 §3.2. True iff the If-None-Match precondition is satisfied.

crates/fula-client/src/encryption.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3383,6 +3383,14 @@ impl EncryptedClient {
33833383
.with_metadata("fula-bucket-lookup-h", &self.compute_bucket_lookup_h_hex(bucket))
33843384
.with_metadata("fula-forest-manifest", "1");
33853385

3386+
// TEMPORARY DIAGNOSTIC for #29.
3387+
tracing::warn!(
3388+
bucket,
3389+
index_key,
3390+
prior_etag = ?prior_etag,
3391+
next_sequence,
3392+
"save_forest (v1 monolithic) conditional PUT diag"
3393+
);
33863394
let put_result = self.inner.put_object_with_metadata_conditional(
33873395
bucket,
33883396
&index_key,
@@ -3724,6 +3732,14 @@ impl EncryptedClient {
37243732
.with_metadata("fula-bucket-lookup-h", &lookup_h_hex)
37253733
.with_metadata("fula-forest-manifest", "1");
37263734

3735+
// TEMPORARY DIAGNOSTIC for #29.
3736+
tracing::warn!(
3737+
bucket,
3738+
index_key,
3739+
prior_etag = ?prior_etag,
3740+
new_seq = next_seq,
3741+
"phase2 conditional PUT diag"
3742+
);
37273743
let put_result = self.inner.put_object_with_metadata_conditional(
37283744
bucket,
37293745
&index_key,

scripts/watch-images-upload.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ echo "===== Tailing $CONTAINER (Ctrl-C to stop). Now upload an image from FxFile
3434
echo "" >&2
3535

3636
docker logs --since 5s -f "$CONTAINER" 2>&1 | grep --line-buffered -iE \
37-
'images|bucket_lookup_h|forest_manifest_cid|flush.*bucket|persist.*registry|concurrent modification|412 Precondition|ConcurrentModificationExhausted|put_object_flat|Phase ?2|save_(sharded_hamt_)?forest|Populated|Restoring bucket|BucketAlreadyExists'
37+
'images|bucket_lookup_h|forest_manifest_cid|flush.*bucket|persist.*registry|concurrent modification|412 Precondition|ConcurrentModificationExhausted|put_object_flat|Phase ?2|save_(sharded_hamt_)?forest|Populated|Restoring bucket|BucketAlreadyExists|match_if_match diag|conditional PUT diag'

0 commit comments

Comments
 (0)