You know, it's funny this hasn't been reported before, because the logic is
wrong. It's perfectly fine to have a changenum per repository, but we're not
factoring in the repository in that one query. Can you please file a bug
against this and we'll get a fix out? I can put together a nightly build
with this fix.

Christian

-- 
Christian Hammond - chip...@chipx86.com
Review Board - http://www.reviewboard.org
VMware, Inc. - http://www.vmware.com


On Mon, Mar 14, 2011 at 4:51 PM, Michael Milbrath <m.milbr...@gmail.com>wrote:

> I've seen a couple errors similar to the following occur in the last
> couple of weeks.  We recently migrated from 1.0.9 to 1.5.4.  I found
> the referenced PR adding the concurrency manager but wonder if it is
> possible the database got in a somewhat invalid state prior to this
> change?   Is there something that I can validate in the database to
> ensure it is consistent or process to fix?
>
> REF
> http://code.google.com/p/reviewboard/issues/detail?id=705
>
> ...
> 2011-03-14 09:28:19,338 - ERROR - Exception thrown for user XXXXXXXXX
> at https://XXXXXXXX/r/new/
>
> get() returned more than one ReviewRequest -- it returned 4! Lookup
> parameters were {'changenum': 18332}
> Traceback (most recent call last):
>  File
> "/build/toolchain/noarch/django-1.2.5/lib/python2.6/site-packages/django/core/handlers/base.py",
> line 100, in get_response
>    response = callback(request, *callback_args, **callback_kwargs)
>  File
> "/build/toolchain/noarch/Djblets-0.6.7/lib/python2.6/site-packages/Djblets-0.6.7-py2.6.egg/djblets/auth/util.py",
> line 46, in _checklogin
>    return view_func(request, *args, **kwargs)
>  File
> "/build/toolchain/noarch/reviewboard-1.5.4.1/ReviewBoard-1.5.4.1-py2.6.egg/reviewboard/reviews/views.py",
> line 68, in new_review_request
>    parent_diff_file=request.FILES.get('parent_diff_path'))
>  File
> "/build/toolchain/noarch/reviewboard-1.5.4.1/ReviewBoard-1.5.4.1-py2.6.egg/reviewboard/reviews/forms.py",
> line 166, in create
>    review_request = ReviewRequest.objects.get(changenum=changenum)
>  File
> "/build/toolchain/noarch/django-1.2.5/lib/python2.6/site-packages/django/db/models/manager.py",
> line 132, in get
>    return self.get_query_set().get(*args, **kwargs)
>  File
> "/build/toolchain/noarch/django-1.2.5/lib/python2.6/site-packages/django/db/models/query.py",
> line 349, in get
>    % (self.model._meta.object_name, num, kwargs))
> MultipleObjectsReturned: get() returned more than one ReviewRequest --
> it returned 4! Lookup parameters were {'changenum': 18332}
>
> mysql> select id, submitter_id, repository_id, changenum from
> reviews_reviewrequest where changenum = 18332;
> +--------+--------------+---------------+-----------+
> | id     | submitter_id | repository_id | changenum |
> +--------+--------------+---------------+-----------+
> |  18284 |           28 |             2 |     18332 |
> |  24555 |         1158 |            10 |     18332 |
> | 216485 |         3484 |            14 |     18332 |
> | 128542 |          767 |            25 |     18332 |
> +--------+--------------+---------------+-----------+
>
> --
> Michael D. Milbrath
> E-mail: m.milbr...@gmail.com
>
> --
> Want to help the Review Board project? Donate today at
> http://www.reviewboard.org/donate/
> Happy user? Let us know at http://www.reviewboard.org/users/
> -~----------~----~----~----~------~----~------~--~---
> To unsubscribe from this group, send email to
> reviewboard+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/reviewboard?hl=en

-- 
Want to help the Review Board project? Donate today at 
http://www.reviewboard.org/donate/
Happy user? Let us know at http://www.reviewboard.org/users/
-~----------~----~----~----~------~----~------~--~---
To unsubscribe from this group, send email to 
reviewboard+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/reviewboard?hl=en

Reply via email to