Brighter icon indicating copy to clipboard operation
Brighter copied to clipboard

Bug: DynamoDbOutbox Archiver Will Delete Undelivered Messages

Open jtsalva opened this issue 1 year ago • 4 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

jtsalva avatar Oct 14 '24 19:10 jtsalva

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.

dhickie avatar Oct 15 '24 07:10 dhickie

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

iancooper avatar Oct 17 '24 09:10 iancooper

Right now the MessageItem constructor is explicitly setting to 0

jtsalva avatar Oct 17 '24 11:10 jtsalva

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 avatar Oct 17 '24 12:10 jtsalva

@jtsalva Is this one fixed?

iancooper avatar Nov 06 '24 21:11 iancooper

#3390 should be the last one

jtsalva avatar Nov 21 '24 00:11 jtsalva

Thanks @jtsalva. Merged

iancooper avatar Nov 21 '24 08:11 iancooper