Skip to content

Manual batch start causes last batch time to appear to be in the future [JIRA: RCS-200] #1143

@nerophon

Description

@nerophon

https://github.com/basho/riak_cs/blob/develop/src/riak_cs_gc_d.erl#L538

Due to next=Last in the line above.

from DaJoe:

that issue is caused by the GC daemon using the 'next' entry in the record as the new 'last' when scheduling a new run
so if you manually start a batch, when it finishes, the last time is set to whenever the next regularly scheduled run would have been
fun is not exported, and only called in 3 places, I think the simplest fix would be to use batch_start instead of next
it is set to undefined immediately before the call
so either wait and set that to undefined here, or set next to batch_start before calling when it makes sense
in the case of the scheduled batch, batch_start and next happen to coincide
but in the case of a manual batch, they don't
schedule_next is called in 3 instances: init, batch completion, and batch cancellation
in the first last should be left undefined, the other two should use batch_start, and since batch_start defaults to undefined, you can use batch_start in all 3

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions