Skip to content

Use last_id to have better buffer tracker in fees recalculation #330

@gusinacio

Description

@gusinacio
          This update mostly solves the problem but it's not 100% accurate. We have a system where we trigger a complete re-calculation of unnagregated receipts. When this happens, newer receipts that are in the queue would already be on the counter and that's why we check if `id > unaggregated_fees.last_id` so we don't have a double counter on that.

The problem is that current system for buffer needs them to be called via add instead of update to be added to the buffer counter. That means that information about what is in buffer is lost under higher loads.

For this to be updated accordingly, tracker would need to have an internal last_id meaning that the value is added to the buffer, but not to the total tracker.

This is not a big issue since the update is usually called in rav requests which reduces total amount, but this issue must be tracked in case problems happen.

Originally posted by @gusinacio in #324 (comment)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions