CCF icon indicating copy to clipboard operation
CCF copied to clipboard

Triggering snapshots while network is in opening state results in no .committed files

Open gaurav137 opened this issue 1 year ago • 2 comments

CCF network was being created on CACI with Azure File Share backed storage for the read-write ledger and snapshots directory. On taking a snapshot by submitting a trigger snapshot proposal while the network was in opening state resulted in the proposal getting accepted but then saw the following: new ledger files got created. but the previous file was not getting renamed to .committed under the ledgers/ folder and no snapshot files getting created under snapshots/.

gaurav137 avatar Sep 06 '24 10:09 gaurav137

@gaurav137 I will add a test that exercises snapshot creation before network open.

File chunking is based on what is set under ledger.chunk_size in the configuration: https://microsoft.github.io/CCF/main/operations/configuration.html#ledger, and the commit watermark. The files are not renamed to .committed until they are closed (i.e. a new chunk has been created), and all entries in the chunk have been committed.

After that point, the next commit will send a ledger_committed message over the ringbuffer to the host: https://github.com/microsoft/CCF/blob/b08724a000b3f2c0c3d3fe04f836e7367130ca09/src/host/ledger.h#L1573 https://github.com/microsoft/CCF/blob/b08724a000b3f2c0c3d3fe04f836e7367130ca09/src/host/ledger.h#L1430

Which causes the file renaming: https://github.com/microsoft/CCF/blob/b08724a000b3f2c0c3d3fe04f836e7367130ca09/src/host/ledger.h#L648

achamayou avatar Sep 12 '24 14:09 achamayou

@achamayou File chunking is based on what is set under ledger.chunk_size in the configuration: https://microsoft.github.io/CCF/main/operations/configuration.html#ledger, and the commit watermark. The files are not renamed to .committed until they are closed (i.e. a new chunk has been created), and all entries in the chunk have been committed. Since I was taking snapshots hence .committed should have appeared immediately as its my understanding that taking of a snapshot forces a generated of .a committed ledger file followed by .committed snapshot file. But what I saw was (quoting from original issue) that new ledger files got created, but the previous file was not getting renamed to .committed under the ledgers/ folder and no snapshot files getting created under snapshots/.

gaurav137 avatar Sep 17 '24 00:09 gaurav137