Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Clear stale records #755
After an error during the check-in procedure on a large IFC file, the BIMserver (v.1.5.96) database got dirty and now the start-up it's slower since it has to check for stale records:
This check it's performed ad each start-up and it's becoming a performance problem, since it's seems that sometimes these records aren't deleted.
Hmm this should indeed not take this long. I don't think this has something to do with the failed checkin, this process simply gets slower and slower with a growing database.
I don't have time to look at this issue right now though, but I'll leave a more technical comment for future me or someone else to fix it:
The nature of this problem is the fact that record keys are composed of pid + oid + rid. We know the pid and also the rid, but the database has no way to "query" for those two specifically (since only the whole key is "indexed"). The only way is to iterate over all records starting with "pid" and skip all the records with the wrong "rid".
The way to solve this is probably to set a bit on the Project object when a checkin starts (and commit it) and then reset it when the checkin has either failed or succeeded. This way only those projects have to be checked. The cleanup process should obviously reset this bit, so that when another restart happens the projects won't be checked a second time. When this is implemented, the "checkinsInProgress" field on the BimServer class can probably be removed and replaced by this bit as well.