GS 7 Beta 19 lost most of my auctions after crash

We finally figured out what’s causing the missing listings issue in GarageSale beta 18 or 19 . See for a little background information below.

Unfortunately, unless you have a backup of your GarageSale’s library in place, there is no way for us to bring back your lost listings. Please upgrade as soon as possible to Beta 20, as it contains a safety net for listings that are “marked for deletion” but haven’t been deleted yet.

A little technical background

Each object (e.g. Listing, Shipping Options, Payment Options) in GarageSale’s database uses a “reference counter” to track the number of other objects it is owned by. If this reference count drops to zero, which means there are no other objects still owning it, an object is marked for deletion and removed from the database at same later point in time.

To speed up working with large number of objects, we moved this reference count from an object’s record to a special place in the database with GarageSale Beta 19. Thus the reference count can be modified without loading an object into memory, speeding up many operations.

When loading objects written by an older beta version, Beta 19 automatically moved the reference count from the object record to this reference count section in the database.

Unfortunately we didn’t anticipate that Beta 19 contained another, unrelated bug. This bug caused our users to switch back to GarageSale Beta 18.

Since Beta 18 is too old to know know about the new special section in the database for reference counts, it assumed and restored a reference count of zero in the database record for loaded objects. By doing so, it marked loaded items for deletion and in some cases deleting them immediately.

Switching back to Beta 19 does not remedy the situation, as it prioritizes the wrong reference count saved by Beta 18 over the older entry in the reference count database. So effected listings stayed marked for deletion.

After we were able to replicate this issue, we added a safety net in Beta 20: If a listing is loaded with a reference count of zero, its reference count will be automatically changed to one to prevent automatically deletion.

Lessons learned

We need to thing about a way to prevent users from switching back to older beta version if we know that a database schema might render them incompatible.

If you are using the GarageSale Beta version in production, you should absolutely make sure you have a working backup system in place. The $50 for a external USB back drive are well spent.