cloudbreak icon indicating copy to clipboard operation
cloudbreak copied to clipboard

CB-18126 - cleanup structured events upon deletion for Datalake service

Open gregito opened this issue 3 years ago • 3 comments

gregito avatar Aug 11 '22 07:08 gregito

from @sodre90: Resize need to be double checked. @kkalvagadda1 , any thoughts?

lnardai avatar Aug 11 '22 08:08 lnardai

@sxxgrc can you please check this as Kalyan is on PTO, maybe it is related to sdx resize, thank you!

sodre90 avatar Aug 15 '22 07:08 sodre90

@sxxgrc can you please check this as Kalyan is on PTO, maybe it is related to sdx resize, thank you!

Thanks for the request Peter, seeing things like this early helps our team a lot.

sxxgrc avatar Aug 15 '22 19:08 sxxgrc

Lol nice that takes care of it, I do think we might as well cover the resize recovery case as well.

Here's what we can change it to:

if (lastFlowLog.isPresent()) {
    if (flowChainLogService.isFlowTriggeredByFlowChain(DatalakeResizeFlowEventChainFactory.class.getSimpleName(), lastFlowLog.get())) {
        eventSenderService.notifyEvent(context, ResourceEvent.DATALAKE_RESIZE_COMPLETE);
    } else if (!flowChainLogService.isFlowTriggeredByFlowChain(DatalakeResizeRecoveryFlowEventChainFactory.class.getSimpleName(), lastFlowLog.get())) {
        structuredEventCleanUpService.cleanUp(payload.getResourceId());
    }
} else {
     structuredEventCleanUpService.cleanUp(payload.getResourceId());
}

Or something along these lines. Hopefully that makes sense even if it is a little cluttered, I just wrote the first thing I thought would solve this but it can definitely be cleaned up some more.

sxxgrc avatar Aug 17 '22 21:08 sxxgrc