Bug 53212 - Block UCS-5 update if samba would probably not start after update with about 200k users
Block UCS-5 update if samba would probably not start after update with about ...
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Samba4
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 5.0
Assigned To: Arvid Requate
Felix Botner
: interim-1
Depends on: 49898 53336
Blocks: 53221
  Show dependency treegraph
 
Reported: 2021-05-03 18:37 CEST by Arvid Requate
Modified: 2023-02-03 16:04 CET (History)
4 users (show)

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2019072221000523
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 Arvid Requate univentionstaff 2021-05-03 18:37:12 CEST
With 200k users samba doesn't start after update from UCS 4.4-8 to UCS 5.0-0

Something with ldb seems stuck. E.g. this command doesn't return

ldbdel  -H /var/lib/samba/private/sam.ldb foo
Comment 1 Arvid Requate univentionstaff 2021-05-03 18:50:43 CEST
Maybe it's due to a problem while automatically converting the database format when samba starts. While experimenting

root@master:~# ldbdel \
  -H /var/lib/samba/private/sam.ldb.d/DC\=BIGENV\,DC\=LOCAL.ldb \
  CN=test1,DC=bigenv,DC=local                  
Repacking database from v1 to v2 format (first record CN=test228209,DC=bigenv,DC=local)
Repack: re-packed 10000 records so far
Repack: re-packed 20000 records so far
Repack: re-packed 30000 records so far
[...]
Repack: re-packed 2060000 records so far
Repack: re-packed 2070000 records so far
ltdb: tdb(/var/lib/samba/private/sam.ldb.d/DC=BIGENV,DC=LOCAL.ldb): tdb_recovery_allocate: overflow recovery area

ltdb: tdb(/var/lib/samba/private/sam.ldb.d/DC=BIGENV,DC=LOCAL.ldb): tdb_transaction_prepare_commit: failed to setup recovery data

Failure during prepare_write): Success -> Success
delete of 'CN=test1,DC=bigenv,DC=local' failed - (Operations error) ltdb_prepare_commit() called without transaction active
Comment 3 Arvid Requate univentionstaff 2021-05-04 14:45:21 CEST
1637b708de | Block the update if Samba SAM database is too large

Package: univention-updater
Version: 15.0.3-52A~5.0.0.202105041442
Branch: ucs_5.0-01637b708de | Block the update if Samba SAM database is too large

Package: univention-updater
Version: 15.0.3-52A~5.0.0.202105041442
Branch: ucs_5.0-0


We will research for a technical solution via Bug #53221
Comment 4 Arvid Requate univentionstaff 2021-05-04 15:17:03 CEST
eaf04af018 fixup

Version: 15.0.3-52A~5.0.0.202105041507
Comment 5 Arvid Requate univentionstaff 2021-05-05 12:32:38 CEST
09fb989e92 | fixup

Version: 15.0.3-52A~5.0.0.202105051227
Comment 6 Arvid Requate univentionstaff 2021-05-06 14:29:07 CEST
8b54b2aac0 | Add hint about Samba TDB size limit to UCS-5 changelog
Comment 7 Felix Botner univentionstaff 2021-05-07 10:56:45 CEST
OK - update is stopped if a samba tdb of about 1.8Gb is found
OK - update50/ignore_samba_tdb_size=true
Comment 8 Florian Best univentionstaff 2021-05-25 16:03:33 CEST
UCS 5.0 has been released:
 https://docs.software-univention.de/release-notes-5.0-0-en.html
 https://docs.software-univention.de/release-notes-5.0-0-de.html

If this error occurs again, please use "Clone This Bug".
Comment 9 Philipp Hahn univentionstaff 2023-02-03 16:04:21 CET
FYI: git:1637b708ded20dbca55f84bb35f42745fdf2156e

base/univention-updater/script/postup.sh:
…
> at now >&3 2>&3 <<EOF>   if [ "$(pgrep …) -lt 10 ]; then  # should be about 25> EOF

Due to lack of quoting that `pgrep` is executed when the `at`-job is *created*, not when it *executes* (later).

Is this code block still needed after the upgrade from UCS 4.4-x to 5.0-0, e.g. for any later patch-level upgrade? I'd like to rip it out for Bug #55640 then.