mozilla / fxa-activity-metrics

A server for managing the Firefox Accounts metrics database and pipeline
1 stars 3 forks source link

chore(scripts): rename sampled tables because of off-by-one error #132

Closed philbooth closed 5 years ago

philbooth commented 5 years ago

Related to #129.

Contrasts to #131, where that approach fixes the off-by-one error but this approach accepts the presence of the error and just renames the tables instead. Would need to be applied in conjuction with a bunch of ALTER TABLE queries:

ALTER TABLE activity_events_sampled_10 RENAME TO activity_events_sampled_11;
ALTER TABLE activity_events_sampled_50 RENAME TO activity_events_sampled_51;
ALTER TABLE daily_activity_per_device_sampled_10 RENAME TO daily_activity_per_device_sampled_11;
ALTER TABLE daily_activity_per_device_sampled_50 RENAME TO daily_activity_per_device_sampled_51;
ALTER TABLE daily_multi_device_users_sampled_10 RENAME TO daily_multi_device_users_sampled_11;
ALTER TABLE daily_multi_device_users_sampled_50 RENAME TO daily_multi_device_users_sampled_51;
ALTER TABLE email_events_sampled_10 RENAME TO email_events_sampled_11;
ALTER TABLE email_events_sampled_50 RENAME TO email_events_sampled_51;
ALTER TABLE flow_events_sampled_10 RENAME TO flow_events_sampled_11;
ALTER TABLE flow_events_sampled_50 RENAME TO flow_events_sampled_51;
ALTER TABLE flow_experiments_sampled_10 RENAME TO flow_experiments_sampled_11;
ALTER TABLE flow_experiments_sampled_50 RENAME TO flow_experiments_sampled_51;
ALTER TABLE flow_metadata_sampled_10 RENAME TO flow_metadata_sampled_11;
ALTER TABLE flow_metadata_sampled_50 RENAME TO flow_metadata_sampled_51;

But, @jbuck and @irrationalagent, are we really sure it's worth doing this if we're also doing #131? This forces people to edit their broken queries twice, once now to pick up the new table names and then again later when they want to update to the fixed schema. Does it make sense to pay that cost for 2 weeks fewer of a bug that has been hanging around us for literally years at this point?

(I'm happy if you think the answer to those questions is "yes" btw, just wanted to make sure we were asking them before taking action)

r?

irrationalagent commented 5 years ago

Yea, not convinced that the renaming is worth it at this point if all we need to do is wait 2 weeks until we get to real 10/50. It would just make more work for you to re-re-name after the re-import.

I already told the other data scientist who would be likely to use these tables about this issue so I believe we won't have any issues there. If anyone else is interested in the data, they will likely come to me or Alex and we both are aware of the problem so can give the proper heads up.

philbooth commented 5 years ago

In that case I'll close this one, thanks @irrationalagent!