Repository navigation
ipa: avoid ipa-restore and copy whole LDAP database instead - #288
Conversation
d323449 to
750414f
Compare
|
PR CI failures are unrelated. It was already fixed upstream but the nightly copr built is outdated. |
| systemctl stop dirsrv.target | ||
| backup /etc/dirsrv "$path/dirsrv-etc" | ||
| backup /var/lib/dirsrv "$path/dirsrv-lib" | ||
| systemctl start dirsrv.target |
There was a problem hiding this comment.
I wonder if there is any downside of this approach (just copying the dirsrv db files/config) compared to the docs recommended dsctl <instance_name> db2bak ?
There was a problem hiding this comment.
There should not be any downside and will probably be faster as it literally does no extra operation. So far I did not run into any issue and why would we? Unless we miss some special folder this is just plain restart for dirsrv.
justin-stephenson
left a comment
There was a problem hiding this comment.
I added one comment to consider but these changes LGTM still, so ack from me.
|
Please also check: |
ipa-restore --data stops dirsrv, imports data and start dirstv. It does not do anything else, but it is prone to race conditions inside 389-ds that can render 389-ds unusable and break ipa. See: 389ds/389-ds-base#7998 Copying the files is easier, should be stable as we do not depend on any component and as a benefit it is blazingly fast - ~1-2s instead of ~10-20s.
import and export operation takes a long time and from time to time we hit the following crash. Switching to manually copying data will hopefully avoid this crash completely and it is also blazing fast. ``` Oct 15 13:41:02 master.keycloak.test kc.sh[14413]: Changes detected in configuration. Updating the server image. Oct 15 13:41:02 master.keycloak.test kc.sh[14413]: WARNING: Usage of the default value for the db option in the production profile is deprecated. Please explicitly set the db instead. Oct 15 13:41:02 master.keycloak.test kc.sh[14413]: Updating the configuration and installing your custom providers, if any. Please wait. Oct 15 13:41:05 master.keycloak.test kc.sh[14413]: 2026-10-15 13:41:05,696 WARN [org.keycloak.common.Profile] (build-71) Deprecated features identity-brokering-api:v1, twitter-broker:v1 enabled by default. Check the upgrading guide for steps to use later versions if available. Oct 15 13:41:06 master.keycloak.test kc.sh[14413]: 2026-10-15 13:41:06,347 INFO [org.freedesktop.dbus.connections.transports.TransportBuilder] (build-71) Using transport dbus-java-transport-native-unixsocket for address unix:path=/var/run/dbus/system_bus_socket Oct 15 13:41:07 master.keycloak.test kc.sh[14413]: [5.290s][warning][os,thread] Failed to start thread "Unknown thread" - pthread_create failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 0k, detached. Oct 15 13:41:07 master.keycloak.test kc.sh[14413]: [5.290s][warning][os,thread] Failed to start the native thread for java.lang.Thread "build-168" Oct 15 13:41:08 master.keycloak.test kc.sh[14413]: ERROR: Failed to run 'start' command. Oct 15 13:41:08 master.keycloak.test kc.sh[14413]: ERROR: io.quarkus.builder.BuildException: Build failure: Build failed due to errors Oct 15 13:41:08 master.keycloak.test kc.sh[14413]: [error]: Build step io.quarkus.deployment.steps.ClassTransformingBuildStep#handleClassTransformation threw an exception: java.util.concurrent.RejectedExecutionException Oct 15 13:41:08 master.keycloak.test kc.sh[14413]: at org.jboss.threads.RejectingExecutor.execute(RejectingExecutor.java:20) Oct 15 13:41:08 master.keycloak.test kc.sh[14413]: at org.jboss.threads.EnhancedQueueExecutor.rejectException(EnhancedQueueExecutor.java:2249) Oct 15 13:41:08 master.keycloak.test kc.sh[14413]: at org.jboss.threads.EnhancedQueueExecutor.doStartThread(EnhancedQueueExecutor.java:1833) Oct 15 13:41:08 master.keycloak.test kc.sh[14413]: at org.jboss.threads.EnhancedQueueExecutor.execute(EnhancedQueueExecutor.java:883) Oct 15 13:41:08 master.keycloak.test kc.sh[14413]: at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:149) Oct 15 13:41:08 master.keycloak.test kc.sh[14413]: at io.quarkus.deployment.steps.ClassTransformingBuildStep.handleClassTransformation(ClassTransformingBuildStep.java:215) Oct 15 13:41:08 master.keycloak.test kc.sh[14413]: at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:735) Oct 15 13:41:08 master.keycloak.test kc.sh[14413]: at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:811) Oct 15 13:41:08 master.keycloak.test kc.sh[14413]: at io.quarkus.builder.BuildContext.run(BuildContext.java:242) Oct 15 13:41:08 master.keycloak.test kc.sh[14413]: at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18) Oct 15 13:41:08 master.keycloak.test kc.sh[14413]: at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2651) Oct 15 13:41:08 master.keycloak.test kc.sh[14413]: at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2630) Oct 15 13:41:08 master.keycloak.test kc.sh[14413]: at org.jboss.threads.EnhancedQueueExecutor.runThreadBody(EnhancedQueueExecutor.java:1622) Oct 15 13:41:08 master.keycloak.test kc.sh[14413]: at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1589) Oct 15 13:41:08 master.keycloak.test kc.sh[14413]: at java.base/java.lang.Thread.run(Thread.java:1474) Oct 15 13:41:08 master.keycloak.test kc.sh[14413]: at org.jboss.threads.JBossThread.run(JBossThread.java:501) Oct 15 13:41:08 master.keycloak.test kc.sh[14413]: Suppressed: java.lang.OutOfMemoryError: unable to create native thread: possibly out of memory or process/resource limits reached Oct 15 13:41:08 master.keycloak.test kc.sh[14413]: at java.base/java.lang.Thread.start0(Native Method) Oct 15 13:41:08 master.keycloak.test kc.sh[14413]: at java.base/java.lang.Thread.start(Thread.java:1417) Oct 15 13:41:08 master.keycloak.test kc.sh[14413]: at org.jboss.threads.JBossThread.start(JBossThread.java:558) Oct 15 13:41:08 master.keycloak.test kc.sh[14413]: at org.jboss.threads.EnhancedQueueExecutor.doStartThread(EnhancedQueueExecutor.java:1829) Oct 15 13:41:08 master.keycloak.test kc.sh[14413]: ... 13 more ```
750414f to
6bb134f
Compare
|
Thank Justin, fixed. I also added a commit that does the same with Keycloak to avoid a crash there. It's also much faster then keycloak's import and export as well. Maybe I will do the same for LDAP. Previsouly, the database was preallocated and had over GB but now with the switch to mdb it has just few MBs. |
|
Looks good to me. Copying the database files instead of going through The speedup matters too, backup and restore run for every test, so 1-2s instead of 10-20s adds up across a full run. Nice that the Keycloak path gets the same treatment and both now look the same. |
ipa-restore --data stops dirsrv, imports data and start dirstv. It
does not do anything else, but it is prone to race conditions inside
389-ds that can render 389-ds unusable and break ipa.
See: 389ds/389-ds-base#7998
Copying the files is easier, should be stable as we do not depend on
any component and as a benefit it is blazingly fast - ~1-2s instead of
~10-20s.