Stefan Miklosovic created CASSANDRA-20209:
---------------------------------------------

             Summary: Two snapshot manifests on same table against same 
SSTables do not have always same size
                 Key: CASSANDRA-20209
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-20209
             Project: Apache Cassandra
          Issue Type: Bug
          Components: Local/Snapshots
            Reporter: Stefan Miklosovic


I noticed that two manifests can have different sizes when snapshot is created 
on same SSTables. This might be hit in practice in tests when I measure that 
two snapshots have same sizes on disk.

The difference is caused by manifest.json, check these two:

{code}
{
  "files" : [ "oa-1-big-Data.db" ],
  "created_at" : "2025-01-15T13:26:45.04Z",
  "expires_at" : null,
  "ephemeral" : false
}
{code}

{code}
{
  "files" : [ "oa-1-big-Data.db" ],
  "created_at" : "2025-01-15T13:27:45.012Z",
  "expires_at" : null,
  "ephemeral" : false
}
{code}

The difference is in "created_at". One manifest has two decimals for 
milliseconds (04) and another one three (012).

The difference is one digit, which will make the whole file bigger, hence their 
sizes do not match, hence the sizes of the snapshots as such do not match.

This causes errors when e.g. running multiplex tests in CI. If test happens to 
generate two manifests with three places for milliseconds (or two) in both 
cases, then it will just pass but every now and then, it doesn't.

The solution is to modify JsonUtils and persuade JSON_OBJECT_MAPPER to 
serialize Instant's always with 3 decimal places.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to