This aligns with what's done for the other object types.
Also:
- Add missing test cases around existing scenario
- Clarify intent about stopping the replayer when an old origin_visit format is
detected.
Differential D2839
journal.replay: Inline `_fix_origin_visit` for loop in insert_object ardumont on Mar 17 2020, 12:12 PM. Authored by
Details
This aligns with what's done for the other object types. Also:
detected. tox
Diff Detail
Event TimelineComment Actions Build is green
Comment Actions Build is green Comment Actions
Except we shouldn't align it like this. Those methods are skipped because they were not added in the existing storage. This diff would skip visits that are already in it, which is not acceptable. The correct fixes for this issue are either
Comment Actions
ok?
I do not understand.
We no longer have visits without type, don't we?
who does such run?
except we do not have the origin_visit's type here. Comment Actions Those objects, I mean. Invalid revisions were refused by the pg storage after being pushed to Kafka. While the origin visits you are proposing to skip were accepted by the pg storage.
We don't, but they were created before having a type and were migrated with an SQL script, without the update being sent to Kafka.
You, olasd, me, ...
Indeed. So the correct fix is to overwrite them in Kafka. Comment Actions
ok, so they should not be there in the first place. Thus the backfill you want to run again.
I'm not changing anything? Or maybe, please, could you pinpoint the code you say is faulty?
Comment Actions They are not bad visits. They are valid visits in a wrong format. If we skip them, then a replayed storage would be missing these visits that the current storage has.
It's not the code, it's the behavior you want Comment Actions The backfill operation only adds new objects, or reformats existing objects. It doesn't remove faulty objects that shouldn't have been here in the first place.
I can confirm that the logic seems almost identical; the only change is that, before this change, the replayer would crash if _fix_origin_visit returned None, instead of just carrying on with the valid origins. Now, I think that @vlorentz's issue (and mine as well) is that this crash shouldn't have happened in the first place : the entries in the origin_visit topic with the old, type-less schema, should have been rewritten by a pass of the backfiller, a while ago. How did the issue get noticed? Do you have a partition/offset reference of a crashy message? Comment Actions (for instance, as we've changed the format of the keys of the origin_visit topic a few times, it's possible that objects which used the old key schema haven't been compacted away) Comment Actions Indeed, that's what I meant by overwrite.
Good point. I don't remember seeing this issue with my replayers (but I don't monitor them very closely) Comment Actions Clarify intent about stopping the replayer when an old origin_visit format is Comment Actions Build is green Comment Actions I like this much better! Could you change the title of the diff and commit accordingly?
Comment Actions
awesome ;)
Like what, i thought i did already even though i admit* it's not that good.
Comment Actions it still says "Align fix origin_visit endpoint with others", while it should mention raising an error (earlier)
Comment Actions journal.replay: Make _fix_origin_visit raise earlier Also:
detected. Comment Actions Build is green Comment Actions
what? it wasn't working on a list before this commit
Comment Actions
hmm yeah, that's true! For the test order, no i won't change it. I'll try to improve the commit message though. Comment Actions Build is green |