10
bioDan
7y

I had a ticket to enhance the loading of a page.

So instead of doing 40K requests to a MySQL DB in order to generate a tree and display it to to the user on each page visit, the initial query was optimized and moreover, the results are saved in a MongoDB which will then are served to the user on each page visit.

Long story short, after a code review the code got shipped to production and there was a bug which got fixed in a Hotfix shortly afterwards.

I got all the blame for the bug.
I don't deny I have a responsibility for the bug.
Do you guys think the code reviewer also has a shared responsibility for the bug?

Comments
  • 1
    Depends if the bug cause could have been easy to spot by reading the code.
    Some bugs are easy to predict, others are not so easy.

    You didn't have QA on the change?
  • 1
    @pmarius it wasn't hard to spot if you have deep knowledge of how instance variables are stored in memory and the way the system is set up (with multiple account based DBs)

    We did have QA on the feature, but we didn't test for differences between accounts
  • 0
    Tree should be 1 query to mysql really
  • 1
    @mikk150 maybe I didn't explain myself correctly, let me elaborate:

    Before refactor:
    Perform 40K queries to DB - generate tree from results - show to user.

    After refactor:
    Perform 40K queries to DB - generate tree from results - save tree to DB - show to user.

    So it's 1 query to DB after tree is generated unless an item has been modified, added, or destroyed. In that case we need to generate the tree from the 40K queries.
Add Comment