BrighterCommand/Brighter

Bug: DynamoDbOutbox Archiver Will Delete Undelivered Messages

Closed this issue · 7 comments

Describe the bug

The archiver finds messages to delete using the following condition:

Topic = :v_Topic and DeliveryTime < :v_SinceTime

DeliveryTime default value is 0, therefore undelivered messages can be deleted by the archiver.

Screenshot shows our Delivered index containing messages with DeliveryTime = 0
Screenshot 2024-10-14 at 20 39 39

Due to #3351 I've not observed this to happen but I suspect it will be a problem?

Proposed fix

Either add a condition to the dynamo query so that DeliveryTime > 0 or make the default DeliveryTime be null.

Further technical details

  • Brighter v9

It makes the most sense to omit the value when initially storing the record (which is not the same thing as setting it to null - null is a value). Otherwise every run of the archiver will be scanning the entire table and lead to unnecessary costs.

Hi @dhickie and @jtsalva. Are we saying it is set to 0, or not set?

Right now the MessageItem constructor is explicitly setting to 0

omit the value when initially storing the record (which is not the same thing as setting it to null - null is a value)

@dhickie in C# isn't setting the value to null the way to omit from the dynamo index? I'm not aware of something like undefined, C# object properties will always have a default value?

@jtsalva Is this one fixed?

#3390 should be the last one

Thanks @jtsalva. Merged