Univention Bugzilla – Bug 28232
Prozessablauf stoppen wenn Dateisystem fast voll ist
Last modified: 2019-03-29 15:37:48 CET
Um einen defekten Listener Cache, eine leere notify_id o.ä. zu vermeiden sollte der Listener bei einem vollen Dateisystem (/var/lib/univention-directory-listener). Ein entsprechender Ansatz wird bereits im Replikationsmodul durch die UCR Variable "ldap/replication/filesystem/limit" (default: 10MB) verfolgt (kann mitldap/replication/filesystem/check=yes aktiviert werden). Ggf. reicht das schon aus (da ja dann auch der Cache nicht mehr aktualisiert wird? - Sollte ggf. geprüft werden), allerdings sollte das evtl. per default aktiviert werden da sonst immer recht aufwendige Reparaturen oder ein neuer Join notwendig sind.
Der Code im Replikation-Listener ist IMHO falsch: - Der Vergleich ist falsch herum: Der Listener stoppt, wenn mehr als 10 Byte frei sind! - Eine Beschreibung der UCR-Variablen fehlt. - Statt os.statvfs() wird jedes mal eine externe Shell + df geforked! - Welche Einheit hat das Limit? Byte, KIB, MiB? Der default ist "10". Grober Patchvorschlag: --- univention-directory-replication/replication.py +++ univention-directory-replication/replication.py @@ -895,6 +859,6 @@ - if listener.baseConfig.get('ldap/replication/filesystem/check', 'false').lower() in ['true', 'yes']: - df = os.popen('df -P /var/lib/univention-ldap/').readlines() - free_space = float(df[1].strip().split()[3])*1024*1024 # free space in MB - limit = float(listener.baseConfig.get('ldap/replication/filesystem/limit', '10')) - if limit < free_space: + if listener.baseConfig.is_true('ldap/replication/filesystem/check', False): + stat = os.statvfs(STATE_DIR) + free_space = stat.f_bavail * stat.f_bsize + limit = listener.baseConfig.get('ldap/replication/filesystem/limit', '10') + if float(free_space) < float(limit) * 1024.0 * 1024.0: PS: Die Variable "df" wird in der nachfolgenden Fehlermeldung noch gebraucht. Entweder ist die zu Ändern oder nur in dem Fall sollte "df" extern aufgerufen werden.
r69830 | Bug #28232 repl: autopep8 -i --max-line-width=220 r69829 | Bug #28232 repl: assorted bash cleanup r69828 | Bug #28232 repl: assorted Python cleanup r69826 | Bug #28232 repl: univention.debug -> ud r69825 | Bug #28232 repl: debian/ cleanup r69824 | Bug #28232 repl: Fix filesystem full check r69822 | Bug #28232 repl: Copyright 2016 Package: univention-directory-replication Version: 9.0.1-3.104.201606061133 Branch: ucs_4.1-0 Scope: errata4.1-2 r69841 | Bug #33594,Bug #41347,Bug #28232,Bug #30489,Bug #31757: univention-directory-logger YAML univention-directory-replication.yaml
(In reply to Philipp Hahn from comment #2) > r69830 | Bug #28232 repl: autopep8 -i --max-line-width=220 You've changed the indentation from tabs to spaces. Please revert this because we use tabs. For example backports would be difficult.
(In reply to Stefan Gohmann from comment #3) > (In reply to Philipp Hahn from comment #2) > > r69830 | Bug #28232 repl: autopep8 -i --max-line-width=220 > > You've changed the indentation from tabs to spaces. Please revert this > because we use tabs. For example backports would be difficult. r71062 | Bug #28232 repl: Make tab-lovers happy again
Code review: Ok Functional test: Ok Advisory: Ok
<http://errata.software-univention.de/ucs/4.1/216.html>