hubcio commented on issue #4128: URL: https://github.com/apache/iggy/issues/4128#issuecomment-5632296400
yes, `SimStorage` already supports directory-sync failures and `Crash::PowerLoss`, including restoring directory entries whose deletion wasn’t synced. that gives us the failure model needed here. what needs plumbing is the production purge and recovery path. directory scans, offset-file deletion, syncing the consumer and consumer-group directories, and persisting/reloading `purge.gen` need to go through `DurableStorage`. recovery needs to reload offsets from the simulated filesystem, and `Next` checks must use that recovered state. the cluster simulator carries offsets across restart in memory, so its normal restart path won’t exercise this failure. the test should preserve the separate offset and marker directories, since syncing one doesn’t make changes in the others durable. the existing storage purge test implements its own sequence and propagates directory-sync errors with `?`, while production logs them and continues. i’d reuse the production cleanup and completion code in that harness so the regression exercises the behavior we’re fixing. then we can persist consumer and group offsets, successfully delete their files, inject a sync failure for each offset directory separately, allow subsequent operations, and trigger power loss. after recovery, we should verify that the completion marker can’t suppress required cleanup, stale offsets are gone once cleanup finishes, and `Next` returns the full fresh history. retries also need to preserve any acknowledged fresh writes. cover both durability policies and a successful-sync control. @krishvishal does that make sense? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
