Value error creating a postgresql replica

Bug #1837825 reported by Mark Kirkwood
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack DBaaS (Trove)
New
Undecided
Unassigned

Bug Description

This is master from a week or so ago (last commit 24 Jun). I'm running it via devstack. The host VM is Ubuntu bionic and the guest image is xenial with Postgres 9.6. The scenario is:

- create a database instance
- add a database and create a table with a few rows
- create another instance, which is a replica thereof

2nd one gets ERROR status, Showing it displays:

File "/home/ubuntu/trove/trove/guestagent/datastore/experimental/postgresql/service.py", line 526, in pg_xlogfile_name |
| | version = int(self.pg_version[1]) |
| | |
| | ValueError: invalid literal for int() with base 10: '9.6'

This is reasonable as the 'version' is the string '9.6' and you can't call int() on that. I fixed this by editing service.py to use a float intermediate cast:

version = int(float(self.pg_version[1]))

I could create a replica ok then.

Unfortunately this is *hard* to reproduce - after reverting my changes today in order to provide more detail on the failure I cannot reproduce even after 5 or so attempts. However the code is clearly doing something dangerous.

Revision history for this message
Mark Kirkwood (mark-kirkwood) wrote :
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.