incomplete version checking in run_query()

Bug #996766 reported by David Shifflett
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
AppScale
In Progress
Critical
Navraj Chohan

Bug Description

With an app like:

class Kind1(db.Model)
  Kind1 properties ...

class Kind2(db.model)
  Kind2 properties ...

k1 = Kind1()
k2 = Kind2()

k1.properties = some value
...
k2.properties = some other value
...
k1.put()
k2.put()

results = db.GqlQuery("SELECT *")

The above app causes the function run_query() in AppDB/appscale_server.py
to be called with a 'kindless' query.

The loop 'for kind in kinds:' at line 546 (in version 787.5.4)
is executed twice, once for Kind1 and once for Kind2.

After this loop the 'versions' list will only have 1 element
and the 'results' list will have two elements.

This is because 'versions' gets overwritten each time through the loop
and only retains the last list of version (transaction) numbers.

This means that the loop 'for index, ii in enumerate(versions):' at line 580
won't validate all of the entities in the 'results' list,
and will probably validate them using incorrect version (transaction) numbers.

Attached is a possible solution (diff against version 787.5.4, from the trunk)

Revision history for this message
David Shifflett (shifflettd) wrote :
Revision history for this message
Navraj Chohan (nchohan) wrote :

Thanks for this patch. It's being merged at the github site. You've been added to the committers list at: http://appscale.cs.ucsb.edu/people.html

Changed in appscale:
importance: Undecided → Critical
assignee: nobody → Navraj Chohan (nchohan)
status: New → In Progress
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.