michaelhelmick / django-balancer

A set of tools for using Django's multi-db feature.
BSD 3-Clause "New" or "Revised" License
110 stars 5 forks source link

DatabaseError: canceling statement due to conflict with recovery #3

Closed bkonkle closed 14 years ago

bkonkle commented 14 years ago
  File "/path/to/my/code/app/templatetags/my_templatetags.py", line 320, in my_templatetag
    users = list(User.objects.filter(favoriters | commenters).distinct())

  File "/path/to/my/code/django/db/models/query.py", line 83, in __len__
    self._result_cache.extend(list(self._iter))

  File "/path/to/my/code/django/db/models/query.py", line 269, in iterator
    for row in compiler.results_iter():

  File "/path/to/my/code/django/db/models/sql/compiler.py", line 672, in results_iter
    for rows in self.execute_sql(MULTI):

  File "/path/to/my/code/django/db/models/sql/compiler.py", line 727, in execute_sql
    cursor.execute(sql, params)

  File "/path/to/my/code/django/db/backends/postgresql_psycopg2/base.py", line 44, in execute
    return self.cursor.execute(query, args)

DatabaseError: canceling statement due to conflict with recovery
DETAIL:  User query might have needed to see row versions that must be removed.
bkonkle commented 14 years ago

This is actually an issue with my Postgres configuration, and it looks like max_standby_streaming_delay is the setting I need to change. Since this isn't actually related to django-balancer, I'm closing this issue.