Bug 49199 - [4.3] Mutliple entries in the transaction file
[4.3] Mutliple entries in the transaction file
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Notifier (univention-directory-notifier)
UCS 4.3
Other Linux
: P5 normal (vote)
: UCS 4.3-3-errata
Assigned To: Philipp Hahn
Stefan Gohmann
:
Depends on: 49198
Blocks: 49194
  Show dependency treegraph
 
Reported: 2019-03-29 14:29 CET by Stefan Gohmann
Modified: 2019-04-04 06:39 CEST (History)
1 user (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 7: Crash: Bug causes crash or data loss
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 5: Blocking further progress on the daily work
User Pain: 0.200
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2019032821000494, 2019031921001509
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Gohmann univentionstaff 2019-03-29 14:29:22 CET
It should be backported to UCS 4.3 as well.

+++ This bug was initially created as a clone of Bug #49198 +++

It can happen that the notifier transfers the changes from the listener/listener file multiple times to the transaction file.

This happens if the LDAP (cn=translog) transaction is aborted for example due to MDB_MAP_FULL.

Suggestion: We reverse the order, first LDAP, then transaction.
Comment 1 Philipp Hahn univentionstaff 2019-03-29 17:38:06 CET
[4.3-3] 448ac9c5f9 Bug #49198 udn: Write to LDAP first, to file later
 management/univention-directory-notifier/debian/changelog | 6 ++++++
 management/univention-directory-notifier/src/notify.c     | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

Package: univention-directory-notifier
Version: 12.0.1-12A~4.3.0.201903291627
Branch: ucs_4.3-0
Scope: errata4.3-3

[4.3-3] 6dc4b89027 Bug #49199: univention-directory-notifier 12.0.1-12A~4.3.0.201903291627
 doc/errata/staging/univention-directory-notifier.yaml | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

OK: # reproducer
  systemctl stop slapd.service univention-directory-notifier.service
  # make slapd return an error != ALREADY_EXIST and != SERVER_DOWN
  sed -i 's/write/read/' /etc/univention/templates/files/etc/ldap/slapd.conf.d/99translog
  ucr commit /etc/ldap/slapd.conf
  # now break UDN
  cd /var/lib/univention-ldap
  tail -n1 notify/transaction | { read -r tid line; printf "%d %s\n%d %s\n" "$((1+tid))" "$line" "$tid" "$line"; } > listener/listener
  systemctl start slapd.service univention-directory-notifier.service
  # watch it
  tail -f listener/listener notify/transaction /var/log/univention/notifier.log
OK: apt install univention-directory-notifier=12.0.1-12A~4.3.0.201903291627
Comment 2 Stefan Gohmann univentionstaff 2019-04-01 08:17:05 CEST
Jenkins tests: OK

Manual tests: OK, it works. I was able to reproduce the original issue. I simply reduced the database size of the translog database and I got a MDB_MAP_FULL. As long as one don't try to rebuild the transaction file with a wrong howto everything works fine even with a duplicated id in the translog file.

Code review: OK

YAML: I would suggest to remove the part "and also can fill up all space of the file system".
Comment 3 Philipp Hahn univentionstaff 2019-04-01 08:53:59 CEST
(In reply to Stefan Gohmann from comment #2)
> YAML: I would suggest to remove the part "and also can fill up all space of
> the file system".

[4.3-3] ded8a5dde8 Bug #49199: univention-directory-notifier 12.0.1-12A~4.3.0.201903291627
 doc/errata/staging/univention-directory-notifier.yaml | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
Comment 4 Stefan Gohmann univentionstaff 2019-04-01 09:11:23 CEST
(In reply to Philipp Hahn from comment #3)
> (In reply to Stefan Gohmann from comment #2)
> > YAML: I would suggest to remove the part "and also can fill up all space of
> > the file system".
> 
> [4.3-3] ded8a5dde8 Bug #49199: univention-directory-notifier
> 12.0.1-12A~4.3.0.201903291627
>  doc/errata/staging/univention-directory-notifier.yaml | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

OK, thanks.
Comment 5 Arvid Requate univentionstaff 2019-04-01 10:18:25 CEST
<http://errata.software-univention.de/ucs/4.3/466.html>