-
Notifications
You must be signed in to change notification settings - Fork 39
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
Need to review entries in inv_dataset
table
#6615
Comments
inv_dataset
table
Thanks for catching this!! Yeah it seems pretty likely that this table is missing from the inventory delete code. We can certainly fix that problem but it's a little harder to fix existing systems. We could try something like: DELETE FROM inv_dataset WHERE inv_collection_id NOT IN (SELECT id FROM inv_collection); But that's a potentially huge transaction and it'd be safer to do it in batches. It looks like you can do something like this but I haven't tested it: DELETE FROM inv_dataset WHERE inv_collection_id NOT IN (SELECT id FROM inv_collection) LIMIT 1000; and we could run that in a loop until it produces no results. We could:
I'd probably lean towards the omdb command. There's a related question of: is this too urgent to wait for the next upgrade? |
The issue doesn't seem to affect the system negatively at the moment AFAICT (I found it only by chance). We can do the cleanup at the next customer rack update after fixing the inventory delete code. |
I this this is only on dogfood, right? Release 10 was cut on Aug 31, and the most recent main commit in it was a032d2a. Given that, I'd probably vote "do this by hand once we've patched this up and updated dogfood"? Sooner if it is becoming problematic? |
@askfongjojo , thank you for filing this issue, this was 100% an oversight on my part. I have a fix ready at at #6632 , which also adds an extra test to try to catch future cases where an inventory subcollection is added but not correctly removed. Looking at |
Fixes #6615 Does not patch existing systems (dogfood) which may have unnecessary inventory entries
(Reopening just so we remember to manually clean up dogfood after 165ddc2 is deployed) |
Could we confirm on all customer locations that they don't have it with:
Expecting to get an error that no such table exists? |
Yes. It'd be nicer if we could confirm via omdb; the same PR that added |
If there is an We could also take a newer |
So the assumptions would be:
I think this check would be pretty much identical to "checking the version of software deployed on the rack", as it would tell you if your codebase is "before inv_dataset" or "after inv_dataset" -- and hopefully, with our release cadence, the "after inv_dataset world" also includes #6632 . FWIW, this is the output of
|
One issue with looking for the presence or absence of datasets in omdb is that an old omdb on a new version of Nexus also wouldn't report them. My suggestion:
You should see output about the schema version.
If a customer has a schema < 96.0.0, they don't have any |
I see that there is an unusally large number of records in this table that has no time_deleted or state fields:
It may be worth confirming if this table is supposed to grow indefinitely. Other
inv_
table seems to be pruned and kept to reasonable sizes (maybe related to #5305).The text was updated successfully, but these errors were encountered: