-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PAY-722] Check if audio_tx_hist backfilling complete #4276
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense to me, but should probably get the eyes of someone who's been closer to this than me too
"index_user_bank_backfill.py | Tried to check if complete, but no stop_sig" | ||
) | ||
return False | ||
else: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: since the if
returns, no need for else
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i see that you're doing this for the other indexers too... consider updating those too if you want.
also, it seems that the check_if_backfilling_complete
all have similar logic. maybe worth considering if can consolidate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
they do but gonna leave that for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - only note is that we can simplify some of this if we treat this key as a set instead of a key for a map and just check existence
discovery-provider/src/app.py
Outdated
redis_inst.delete("index_user_bank_backfill_complete") | ||
redis_inst.delete("index_rewards_manager_backfill_complete") | ||
redis_inst.delete("index_spl_token_backfill_complete") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think we need to / want to delete these here - don't we want these bools to persist across container restarts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... not sure it matters as they will be persisted in the db anyways.
try: | ||
redis_result = redis.get(index_spl_token_backfill_complete) | ||
if redis_result: | ||
is_spl_token_backfill_complete = str(redis_result.decode()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: maybe bool?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct me if I'm wrong but I don't think we can store bools in redis, so I'm storing a string that says either 'false' or 'true' and just checking against those values.
if redis_complete: | ||
redis_complete = str(redis_complete.decode()) | ||
if redis_complete == "true": | ||
return True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: if just checking for the existence of this key in redis, we wouldn't don't need this comparison
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ooohhh I see.
index_rewards_manager_backfill_complete, "true" if complete else "false" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for simplicity, let's just not set the key at all if the backfill isn't complete. also, 1 or 0 probs a bit nicer convention to represent this kind of thing than stringifying 'true'
Description
Adds fields in health check that tell us whether the backfill indexing for
audio_tx_history
is complete by caching the results of each indexer'scheck_if_backfilling_complete
fns in redis. Also checks the redis cache in thecheck_if_backfilling_complete
functions themselves to return early if we've already determined that indexer is complete.Tests
Observed behavior in remote-dev that is indexing prod.
Monitoring - How will this change be monitored? Are there sufficient logs / alerts?
Lots of error logs if something goes south.