I’m looking at sync times for report submissions in January, and for most submissions initial_replication_date is populated with an ISO formatted date. However, a very small minority (0.01%) has ‘unknown’ value for initial replication date. I’m curious about scenarios that could be causing this behavior.
I believe this would be only be caused by a race condition where the doc is processed by sentinel in very quick succession after being created.
We create infodocs async in API, when docs are pushed. So the doc is written to the medic db first, and then the infodoc gets created and saved in medic-sentinel. If sentinel processes the doc before the initial infodoc write, this can happen.
From our sampling of docs, it happened for 5 reports out of 15115 reports for Nairobi in Jan. It didn’t happen at all in Nov or Dec (roughly same sample size of docs).
Would more API restarts increase likelihood? If an infodoc write is queued and the service goes down, then it would never get written?