pontoon icon indicating copy to clipboard operation
pontoon copied to clipboard

Some entities have duplicate resource, order

Open bugzilla-to-github opened this issue 8 years ago • 7 comments

This issue was created automatically by a script.

Bug 1436191

Bug Reporter: @phlax CC: @mathjazz

Not sure if this is by design, but it seems there are entities that have duplicate resource, order.

It would be good to unique_together these columns if its possible, and im wondering if the dupes are creating ambiguous ordering.

bugzilla-to-github avatar Feb 06 '18 06:02 bugzilla-to-github

Comment Author: @mathjazz

This is not by design.

We should investigate if this is still happening. It's possible that we fixed the code but not the data.

I'm in favour of adding unique_together.

bugzilla-to-github avatar Feb 06 '18 17:02 bugzilla-to-github

Comment Author: GitHub Bugzilla PR Linker <[email protected]>

Created attachment 8949741 Link to GitHub pull-request: https://github.com/mozilla/pontoon/pull/846

Attached file: file_168252667.txt (text/x-github-pull-request, 43 bytes) Description: Link to GitHub pull-request: https://github.com/mozilla/pontoon/pull/846

bugzilla-to-github avatar Feb 08 '18 22:02 bugzilla-to-github

Comment Author: @github-actions

Commit pushed to master at https://github.com/mozilla/pontoon

https://github.com/mozilla/pontoon/commit/32e9229336d386a58e75effa467c063fefea95da Fix Bug #1436191: Entity resource order unique #846

  • Add migration to fix duplicate entity resource, order
  • Make entity resource, order unique_together
  • Adjust tests to prevent duplicate entity resource, order
  • Add order to Entity.create
  • Add order when saving new strings to entities
  • Add order in EntityFactory

bugzilla-to-github avatar Feb 13 '18 19:02 bugzilla-to-github

Comment Author: @mathjazz

This patch breaks sync with a series of errors of type:

IntegrityError: duplicate key value violates unique constraint "base_entity_resource_id_8b220f43_uniq"

See server log for details.

Also, the 0116 migration is not reversible (a simple migrations.RunPython.noop would do), so I couldn't unapply it.

bugzilla-to-github avatar Feb 14 '18 16:02 bugzilla-to-github

Comment Author: @github-actions

Commit pushed to master at https://github.com/mozilla/pontoon

https://github.com/mozilla/pontoon/commit/28a492cd31368cf11d2f565d5edf3d31a714cc68 Revert "Fix Bug #1436191: Entity resource order unique #846"

This reverts commit 32e9229336d386a58e75effa467c063fefea95da.

bugzilla-to-github avatar Feb 14 '18 16:02 bugzilla-to-github

Comment Author: @mathjazz

While this patch was deployed to production (18:50 UTC, February 14, 2018 - 08:10 UTC, February 15, 2018), sync was breaking (didn't actually sync) for 9 projects:

  • Firefox
  • Thunderbird
  • AMO Frontend
  • Mozilla.org
  • SUMO
  • AMO
  • Firefox for Android
  • Lightning
  • Pontoon Intro

I reverted the patch and unapplied migration 0117 (I could unapply 0116 as noted above) and now sync works.

We should investigate what went wrong and figure out how to proceed.

Perhaps we should first land the fix for migration 0116 so that we can unapply it.

bugzilla-to-github avatar Feb 14 '18 16:02 bugzilla-to-github

Comment Author: @mathjazz

The migration has been unapplied, hence this bug is less urgent now.

bugzilla-to-github avatar Mar 12 '18 03:03 bugzilla-to-github