celery_backend/runner: Switch write order to rabbitmq then postgresql
Messages are now first sent to rabbitmq then postgresql. In the nominal case where all writes are ok, that changes nothing vs the previous implementation (postgresql first then rabbitmq). In degraded performance though, that's supposedly better. 1. If we cannot write to rabbitmq, then we won't write to postgresql either, that function will raise and stop. 2. If we can write to rabbitmq first, then the messages will be consumed independently from this. And then, if we cannot write to postgresql (for some reason), then we just lose the information we sent the task already. This means the same task will be rescheduled and we'll have a go at it again. As those kind of tasks are supposed to be idempotent, that should not a major issue for their upstream. Also, those tasks are mostly listers now and they have a state management of their own, so that should definitely mostly noops (if the ingestion from the previous run went fine). Edge cases scenario like down site will behave as before. Refs. swh/infra/sysadm-environment#5512
Please register or sign in to comment