Skip to content

Conversation

@fmoessbauer
Copy link
Member

Writes are not guaranteed to be sequential with bmap, we should therefore report bytes that were written to the storage instead of the position within the storage.

[Felix: also account seeks into writes to fullfill written==size assertion on client side. Downgrade to refactoring]

Suggested by: Felix Moessbauer [email protected]

Writes are not guaranteed to be sequential with bmap, we should
therefore report bytes that were written to the storage instead
of the position within the storage.

[Felix: also account seeks into writes to fullfill written==size
assertion on client side. Downgrade to refactoring]

Suggested by: Felix Moessbauer <[email protected]>
Signed-off-by: Cedric Hombourger <[email protected]>
@fmoessbauer
Copy link
Member Author

This replaces #495. To remain API compatible, we also account seeks into the writes. But at least this is a start to get rid of the global storage state.

@fmoessbauer fmoessbauer marked this pull request as draft August 12, 2025 15:22
@fmoessbauer
Copy link
Member Author

@chombourger My plan for this PR is to completely replace the storage_status calls by events. As of now, this is not an API break, but by latest the storage status events will need it. For that, I'll mark the first commit that breaks the API.

Once we have storage status (INITIALIZED / CORRUPTED) events in place, I can also work on proper progress reporting as we then can individually track the written data (currently we can't to avoid the API break and as we need written==size to check if the writing was successful).

We already get the progress via the event channel and also call the
progress reporting callback there. By that, we no longer explicitly need
to check the storage status for progress (but we need to do it for
correctness / status).

We now drop the callback invocations along with the now empty progress
method.

Signed-off-by: Felix Moessbauer <[email protected]>
The agent.storage_flush is a blocking call that waits for completion of
the storage write operation. By that, there is no need to continously
check for the storage status after returning.

Signed-off-by: Felix Moessbauer <[email protected]>
In a617348, a final storage write event was added to ensure the progress
bar completes instead of stopping below 100%. This however broke the
state machine of the web UI, as it uses the INITIALIZED / CORRUPTED
event to inform the user about the termination of the storage write.

We fix this by moving the final write event into the writer itself and
prior to the termination storage event. A nice side effect is a
simplified code with less cross-module calls.

Fixes: a617348 ("perf(cli): use event channel for "storage write")
Signed-off-by: Felix Moessbauer <[email protected]>
We only need to report if the storage write operation was successful or
not. As we already get this information from the storage_flush method,
we don't need to call storage_status. By that we can't report the
exact position at which the storage write failed, but if this is of any
interest in the future, we still can get it from the final storage write
event.

Signed-off-by: Felix Moessbauer <[email protected]>
@fmoessbauer fmoessbauer force-pushed the storage-bytes-written branch from aecb994 to 91d988d Compare August 13, 2025 08:58
@fmoessbauer fmoessbauer marked this pull request as ready for review August 13, 2025 10:35
@fmoessbauer
Copy link
Member Author

@chombourger This should not have any API breaking changes (at least not compared to the previous MTDA version). I would like to merge this prior to bigger refactorings, as this helps to reduce the review effort.

@fmoessbauer
Copy link
Member Author

@chombourger I have one last commit that fixes the non-linearity of the progress reporting in an ABI compatible way. Shall I add it here as well, or do you prefer a follow up MR?

@chombourger chombourger changed the base branch from master to next August 19, 2025 18:17
@chombourger chombourger merged commit 8fe326d into siemens:next Aug 19, 2025
5 checks passed
@fmoessbauer fmoessbauer deleted the storage-bytes-written branch August 19, 2025 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants