Zum Inhalt springen
Odoo Menü
  • Anmelden
  • Jetzt gratis testen
  • Apps
    Finanzen
    • Buchhaltung
    • Rechnungsstellung
    • Spesenabrechnung
    • Tabellenkalkulation (BI)
    • Dokumente
    • E-Signatur
    Vertrieb
    • CRM
    • Vertrieb
    • Kassensystem – Shop
    • Kassensystem – Restaurant
    • Abonnements
    • Vermietung
    Websites
    • Website-Builder
    • E-Commerce
    • Blog
    • Forum
    • Livechat
    • E-Learning
    Lieferkette
    • Lager
    • Fertigung
    • PLM
    • Einkauf
    • Wartung
    • Qualität
    Personalwesen
    • Mitarbeiter
    • Personalbeschaffung
    • Abwesenheiten
    • Mitarbeiterbeurteilung
    • Personalempfehlungen
    • Fuhrpark
    Marketing-
    • Social Marketing
    • E-Mail-Marketing
    • SMS-Marketing
    • Veranstaltungen
    • Marketing-Automatisierung
    • Umfragen
    Dienstleistungen
    • Projekte
    • Zeiterfassung
    • Außendienst
    • Kundendienst
    • Planung
    • Termine
    Produktivität
    • Dialog
    • Genehmigungen
    • IoT
    • VoIP
    • Wissensdatenbank
    • WhatsApp
    Apps von Drittanbietern Odoo Studio Odoo Cloud-Plattform
  • Branchen
    Einzelhandel
    • Buchladen
    • Kleidergeschäft
    • Möbelhaus
    • Lebensmittelgeschäft
    • Baumarkt
    • Spielwarengeschäft
    Essen & Gastgewerbe
    • Bar und Kneipe
    • Restaurant
    • Fast Food
    • Gästehaus
    • Getränkehändler
    • Hotel
    Immobilien
    • Immobilienagentur
    • Architekturbüro
    • Baugewerbe
    • Immobilienverwaltung
    • Gartenarbeit
    • Eigentümervereinigung
    Beratung
    • Buchhaltungsfirma
    • Odoo-Partner
    • Marketingagentur
    • Anwaltskanzlei
    • Talentakquise
    • Prüfung & Zertifizierung
    Fertigung
    • Textil
    • Metall
    • Möbel
    • Speisen
    • Brauerei
    • Firmengeschenke
    Gesundheit & Fitness
    • Sportklub
    • Brillengeschäft
    • Fitnessstudio
    • Therapeut
    • Apotheke
    • Friseursalon
    Handel
    • Handyman
    • IT-Hardware & -Support
    • Solarenergiesysteme
    • Schuster
    • Reinigungsdienstleistungen
    • HLK-Dienstleistungen
    Sonstiges
    • Gemeinnützige Organisation
    • Umweltschutzagentur
    • Plakatwandvermietung
    • Fotostudio
    • Fahrrad-Leasing
    • Software-Händler
    Alle Branchen ansehen
  • Community
    Lernen
    • Tutorials
    • Dokumentation
    • Zertifizierungen
    • Schulung
    • Blog
    • Podcast
    Bildung fördern
    • Bildungsprogramm
    • Scale-Up! Planspiel
    • Odoo besuchen
    Software anfragen
    • Herunterladen
    • Editionen vergleichen
    • Releases
    Zusammenarbeiten
    • Github
    • Forum
    • Veranstaltungen
    • Übersetzungen
    • Partner werden
    • Dienstleistungen für Partner
    • Buchhaltungsfirma registrieren
    Services anfragen
    • Partner finden
    • Buchhalter finden
    • Einen Experten treffen
    • Implementierungsservices
    • Kundenreferenzen
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Eine Demo erhalten
  • Preiskalkulation
  • Hilfe

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Buchhaltung
  • Lager
  • PoS
  • Projekte
  • MRP
All apps
Sie müssen registriert sein, um mit der Community zu interagieren.
Alle Beiträge Personen Abzeichen
Stichwörter (Alle anzeigen)
odoo accounting v14 pos v15
Über dieses Forum
Sie müssen registriert sein, um mit der Community zu interagieren.
Alle Beiträge Personen Abzeichen
Stichwörter (Alle anzeigen)
odoo accounting v14 pos v15
Über dieses Forum
Hilfe

Odoo 13 + Postgresql 13.1: ERROR: invalid memory alloc request size 1073741824 when upgrading addon in database with 55M records

Abonnieren

Erhalten Sie eine Benachrichtigung, wenn es eine Aktivität zu diesem Beitrag gibt

Diese Frage wurde gekennzeichnet
postgresqlmemoryOdoo13postgresql12
10872 Ansichten
Avatar
Fernando Gomes

Hello all,

I have a rather big database in Odoo 13 (around 55Milion records ~ 50GB postgres database, without filestore).

I have done a clean setup with Ubuntu 20.04 LTS, backed the DB from the old server and restored using pg_restore into the new server. I am using Postgres 13.1 but this also happens with Postgres 12.4.

The database opens fine and I can do all the expected operations with it (create, edit, search, ...).

The problem is quite simple: When I try to upgrade an addon, Odoo generates a HUGE query with ALL of the 55M IDs. Postgres gives the error: "ERROR: invalid memory alloc request size 1073741824". I am doing the update via command-line with a command like this: 

setup/odoo -u myaddonname -d database_name --addons-path=/home/developer/eclipse-workspace/odoo-13.0/odoo/addons

I have tweaked with the postgres parameters and even rented a 32CPU + 128 GB RAM VM at AWS just to make sure it was not a problem with resources.


Postgres is running with the following parameters:

postgres -c max_connections=20 -c shared_buffers=32GB -c effective_cache_size=96GB -c maintenance_work_mem=1GB -c checkpoint_completion_target=0.9 -c wal_buffers=16MB -c default_statistics_target=500 -c random_page_cost=1.1 -c effective_io_concurrency=200 -c work_mem=52428kB -c min_wal_size=4GB -c max_wal_size=16GB -c max_worker_processes=32 -c max_parallel_workers_per_gather=16 -c max_parallel_workers=32

(I got these from PGTune at https://pgtune.leopard.in.ua/#/)

Is there a way to make the addon update process simpler? Or is there a parameter that I can change in Postgres to allow such a big query to be executed?

Any clue would be much appreciated!

Fernando
0
Avatar
Verwerfen
Ray Carnes (ray)

Which add-on?

Fernando Gomes
Autor

The problem seems to be with a field that is declared as inheritence by delegation (not the normal inheritance used in most of Odoo's addons). The relation is declared using the _inherits and not the _inherit.

We have several levels of inheritance and Odoo does a search for ALL of the IDs in all of the inheritance levels. This leads to a 55M ids in the IN part of the query for ALL models in the database... :/

Fernando Gomes
Autor

Hello Ray,

Its a custom addon with a simple model with about 20 fields. This works fine with about 100K records (test database). But when I run the same process with the production database that has 55M records I allways get this error!

I have noticed that if I change the source-code at line 5739 (_modified_triggers(self, tree, create=False):

image0

And change this to:

image1

It runs rather slow but it seems to avoid the error...

I didn't, however, wait for it to complete... maybe it would give the same error...


Is there any way to increase this 1073741824 memory limit in postgres? I have search a lot in google and it seems that this value (exactly 1GB) is hardcoded in Postgres' source-code.

Any clue would be VERY appreciated... I have spent days with this and without any success, so far...

Thanks!

EDIT: I have also tested using the most recent Odoo 13.0.0 from source (from todays' date: 2020-12-25). The models.py file is different, but the result is the same... :/

The problem is that Odoo runs a query to get ALL the IDs at once (55M ids) and then uses those IDs in the next query in an "IN" statement like this: SELECT "table".id FROM "table" WHERE ("table"."iid" in (     [ Here we have the 55M Ids ]     ).

For what I have researched the problem is because of the computation of dependent fields (fields that are related to other fields). Odoo iterates through ALL of the records to compute these fields...

Diskutieren Sie gerne? Treten Sie bei, statt nur zu lesen!

Erstellen Sie heute ein Konto, um exklusive Funktionen zu nutzen und mit unserer tollen Community zu interagieren!

Registrieren
Verknüpfte Beiträge Antworten Ansichten Aktivität
Odoo 13 (docker) no longer reading database from postgresql
database postgresql Odoo13.0 Odoo13
Avatar
0
Feb. 20
3618
Use case review: Odoo Evaluation / Thoughts for custom CRM
development apps postgresql Evaluation Odoo13
Avatar
0
Mai 20
5278
odoo13 report
Odoo13
Avatar
Avatar
1
Juli 25
3517
When Odoo 14 connects to PostgreSQL 15.7, the connection is idle but cannot be released
postgresql
Avatar
0
Feb. 25
3033
psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: fe_sendauth: no password supplied
postgresql
Avatar
Avatar
Avatar
2
Jan. 25
10374
Community
  • Tutorials
  • Dokumentation
  • Forum
Open Source
  • Herunterladen
  • Github
  • Runbot
  • Übersetzungen
Dienstleistungen
  • Odoo.sh-Hosting
  • Support
  • Upgrade
  • Individuelle Entwicklungen
  • Bildung
  • Buchhalter finden
  • Partner finden
  • Partner werden
Über uns
  • Unsere Firma
  • Markenwerte
  • Kontakt
  • Karriere
  • Veranstaltungen
  • Podcast
  • Blog
  • Kunden
  • Rechtliches • Datenschutz
  • Sicherheit
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo ist eine Suite von Open-Source-Betriebsanwendungen, die alle Bedürfnisse Ihres Unternehmens abdecken: CRM, E-Commerce, Buchhaltung, Lager, Kassensystem, Projektmanagement etc.

Das einzigartige Wertversprechen von Odoo ist, dass es gleichzeitig sehr einfach zu bedienen und voll integriert ist.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now