diff --git a/lib/cmdlib.py b/lib/cmdlib.py
index 1317275fe1370530ef66b274f0329aa2dc53386c..5d353c82f96bbec3f78dcefc54042c7602c22f4d 100644
--- a/lib/cmdlib.py
+++ b/lib/cmdlib.py
@@ -1556,14 +1556,11 @@ class LUSetClusterParams(LogicalUnit):
       self.cluster.beparams[constants.BEGR_DEFAULT] = self.new_beparams
     if self.op.candidate_pool_size is not None:
       self.cluster.candidate_pool_size = self.op.candidate_pool_size
+      # we need to update the pool size here, otherwise the save will fail
+      _AdjustCandidatePool(self)
 
     self.cfg.Update(self.cluster)
 
-    # we want to update nodes after the cluster so that if any errors
-    # happen, we have recorded and saved the cluster info
-    if self.op.candidate_pool_size is not None:
-      _AdjustCandidatePool(self)
-
 
 class LURedistributeConfig(NoHooksLU):
   """Force the redistribution of cluster configuration.