Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Postgresql replication - Problem with pgpool2 and transient model and binary field

By
Thierry Godin
on 5/16/14, 10:20 AM 2,515 views

Hi all,

I'm trying to set another server that will be the duplicate of the first server (production). So I set up 2 exactly same servers, tuned PG same too, installed pgpool2 on first server, installed postgresql-9.1-pgpool2 on both servers. I set up OpenERP to connect to pgpool2 on port 5433. Set the 2 backends as follow in pgpool.conf (for now , its on LAN for testing purpose) :

backend_hostname0 = '192.168.1.110'
backend_port0 = 5432
backend_weight0 = 1
backend_data_directory0 = '/var/lib/postgresql/9.1/main/'
backend_flag0 = 'ALLOW_TO_FAILOVER'

backend_hostname1 = '192.168.1.120'
backend_port1 = 5432
backend_weight1 = 1
backend_data_directory1 = '/var/lib/postgresql/9.1/main/'
backend_flag1 = 'ALLOW_TO_FAILOVER'

All works fine.
I can connect to OpenERP on server 1 and data is well duplicated on both PG.

But it seems to have some troubles with transientModel.

Each time I call a module  (I made) that uses TransientModel, I get an error like below :

 ---

File "/usr/lib/pymodules/python2.7/openerp/tools/image.py", line 103, in
image_resize_image_medium
    return image_resize_image(base64_source, size, encoding, filetype,
avoid_if_small)
  File "/usr/lib/pymodules/python2.7/openerp/tools/image.py", line 67, in
image_resize_image
    image_stream = io.BytesIO(base64_source.decode(encoding))
  File "/usr/lib/python2.7/encodings/base64_codec.py", line 42, in base64_decode
    output = base64.decodestring(input)
  File "/usr/lib/python2.7/base64.py", line 321, in decodestring
    return binascii.a2b_base64(s)
Error: Incorrect padding

If I go back to standard config (one server and direct to PG) , OpenERP works fine. So I think there is a problem with binary fields and transientmodel ??

Can anyone help me please ?

Thanks a lot

 

EDIT 2014-05-22:

It seems that Openerp makes SELECT queries that are operated on both PG servers, so that binary fields are corrupted because of transient model ? Id o not have any trouble with models, except with transient ones.

I'm looking for a simple replication solution for PostgreSQL. I searched on GG but I did not find anything so "easy" to install. I do not need load balancing, I just want to save data (streaming replication) for backup purpose and switch on failover.

0

Thierry Godin

--Thierry Godin--
1516
| 8 7 8
Collegien, France
--Thierry Godin--

..

Thierry Godin
On 5/23/14, 7:39 AM

Thanks but I'm not sure pgbouncer is for replication.

Anyway, I've finally gone with native PG replication thanks to the excellent tutorial found on Greg Reinacker's Blog

http://www.rassoc.com/gregr/weblog/2013/02/16/zero-to-postgresql-streaming-replication-in-10-mins/

6

swapnil wagh

--swapnil wagh--
1559
| 6 5 8
Pune, India
--swapnil wagh--

My name is Swapnil A. Wagh. I studied Master Of computer Science and work as a Software Engineer. I’m a technology enthusiast and always eager to learn new and exciting technologies. I’m constantly looking for innovative solutions to age-old problems that push the limits of what we conceive to be possible.

swapnil wagh
On 5/23/14, 7:19 AM

You can try pgbouncer 

0

Axel Mendoza

--Axel Mendoza--
10318
| 7 7 8
Camaguey, Cuba
--Axel Mendoza--

DevOps - Full stack - Software Architect - Developer - Technology Integrator

I could help you to develop anything and solve complex problems based on technologies, integrations and tricky stuffs mostly in Python with OpenERP/Odoo, Zato, Django and many others frameworks programming languages and technologies.

I offers consulting services to anyone with an unanswered questions or needs for customizations. Think about it, maybe it's better to have an expert to solve your issues and projects than having a full time employee trying to understand what to do an how

Reach me at aekroft@gmail.com

Axel Mendoza
On 8/4/14, 6:54 AM

You only need to turn off replication in pgpool.conf. I have this issue and get resolved turning replication off

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

4 follower(s)

Stats

Asked: 5/16/14, 10:20 AM
Seen: 2515 times
Last updated: 3/16/15, 8:10 AM