-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat(cost-model): implement compute_operation_cost
#44
Conversation
@xx01cyx It would be awesome if you can double check the important logic, like |
if store_output_statistic { | ||
let res = self | ||
.storage_manager | ||
.store_cost(context.expr_id, None, Some(output_statistic.clone()), None) | ||
.await; | ||
if res.is_err() { | ||
eprintln!("Failed to store output statistic"); | ||
} | ||
}; | ||
Ok(output_statistic) |
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.
This might cause problem if some stats are missed from the storage. We should in the future consider having sth like a retry queue to store failed database requests. But I'm good with this for now. Maybe we can add a comment here.
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.
Sure, I think the retry should be handled by the storage manager, and I will add a comment there. I don't think it is a big deal, since maybe we can recalculate it again?
Also, the logic for invalidating a cost seems to be missing here. I did not comment on the code because I'm not sure what is meant by "valid". The logic should be added after #44 (comment) is resolved. |
I think the logic of invalidating a cost is handled by update_stats? |
Oh yeah you're righg |
compute_operation_cost