68

I always thought that Suffrage (use 30 votes in a day) is a one-time badge, until I saw this user earned it twice.

He got two in the same day with a 5 minute gap. Is this a bug?

I thought in backend logic, there is a badge type attribute, this kind of badge will be flagged as unique, and no matter how to trigger multi-thread, this will only be rewarded once. This is a way to avoid this kind of bug.

19
  • 19
    Looks like a glitch in the matrix...
    – cs95
    Commented May 7, 2019 at 2:28
  • 6
    how lucky, I wish I get this glitch, like a misprint stamp : ) @cs95
    – recnac
    Commented May 7, 2019 at 2:31
  • 58
    My guess is that the bug has some logic like "If user uses vote number 30 and has not earned the badge, award it," then the user undid their vote, and 5 minutes later again met the criteria by reaching vote #30, putting another instance of the badge being awarded into the script that awards the badges. Interesting find, and very likely a bug.
    – Davy M
    Commented May 7, 2019 at 4:39
  • 6
    Reminds me of meta.stackexchange.com/questions/311662
    – Pang
    Commented May 7, 2019 at 5:34
  • 3
    I guess because he got 25 upvotes and someone retracted, then another upvote? same mechanism with this one @Pang
    – recnac
    Commented May 7, 2019 at 5:38
  • 4
    He's the only one on the whole site with multiple suffrage badges: query (adapted query from this answer). It's definitely a bug, unless they've recently changed how the badge works.
    – Skeets
    Commented May 7, 2019 at 6:24
  • 7
    The machine burped badly today, canonical is here. Commented May 7, 2019 at 6:31
  • 2
    So, is this an attempt to lure people to the review queues to use up their votes, to see if they can earn a double too? Commented May 7, 2019 at 9:32
  • 6
    Possible duplicate of The reputation tab shows that I have earned the [c] tag badge two times Commented May 7, 2019 at 12:30
  • 28
    @KevinKruse That's a very different issue, tag badges can be awarded, removed, and reawarded by design. The suffrage badge can't be taken away, so the dual rewarding is a bug.
    – Davy M
    Commented May 7, 2019 at 13:21
  • 2
    There are many badges that can be awarded more than once, as long as it's a different post/queue and as long as it doesn't say "first" either.
    – Braiam
    Commented May 7, 2019 at 18:07
  • 12
    Here's a list of one-time badges awarded multiple times: data.stackexchange.com/stackoverflow/query/1042894/… and here's a list of their users: data.stackexchange.com/stackoverflow/query/1042843/… (I could be wrong about filtering some of the badges in, but my guess is that most of these badges have caveats that let you win them multiple times).
    – Pluto
    Commented May 7, 2019 at 20:22
  • 5
    Ok I updated the first query to show that there was definitely something happening between June 20th and 29th of 2018 to cause users to pick up multiple badges. There are 8 separate one-time badges that were awarded to users multiple times only during those few days (out of the 17 total badges I queried of all time). This included the Suffrage badge. The only relevant news around that time I could find was launching an initiative to make Stack Overflow more inclusive of new users: stackoverflow.blog/2018/06/21/…
    – Pluto
    Commented May 7, 2019 at 23:48
  • 14
    @Skeets Eeek! that's me, that was strange Commented May 8, 2019 at 0:21
  • 2
    @JackBashford Many badges are awarded by a script that runs periodically. So between the time that the badge is put into the queue for awarding on next run of the script, and when the user met the requirements, the person could have met the requirements twice, and gotten it put in to be awarded twice. Although there's a hole I noticed in my logic, because the time stamp would be when the script ran, and if the person passed 30 votes 5 minutes apart, then those events should be right near each other in the queue and be awarded close together.
    – Davy M
    Commented May 8, 2019 at 2:02

1 Answer 1

13

Yes, this most definitely is a bug. I went digging into the SQL mines and found other cases of duplicate badges being awarded when they shouldn't have. Based on the award date, I looked back through our records and am 99.9% sure of the cause.

More specifically the issue has to due with the fact that we are using Always On Availability Groups. This allows us to use our secondary SQL Server as a readable server. When we award badges, we query the readable secondary to check if the badge has been awarded, if not, then award on the primary SQL Server.

The problem arises when we have a large process that runs on our primary SQL Server that results in the transaction logs (t-logs) to explode in size. The transaction logs need to replay or write to the secondary SQL Servers. If the process of writing the t-logs takes longer than amount of time between badge grants, then we can get these duplicates. It's rare but it happens.

I'm going to mark this as because while the clean up of the duplicates is quick, the actual fix is going to take us a bit of time. We'll be investigating the best way to prevent this from happening in the future and implementing a permanent fix.

2
  • 4
    While the dry docs from Microsoft are fine, let me advertise the awesome blog you wrote about this availability group thingy: tarynpivots.com/post/…
    – rene
    Commented Jan 7, 2020 at 20:00
  • @rene me: blushing at my desk thanks :)
    – Taryn StaffMod
    Commented Jan 7, 2020 at 20:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .