Skip to content

Commit

Permalink
Fix issue with analyze after upgrade (#559)
Browse files Browse the repository at this point in the history
ensure we don't divide by zero
  • Loading branch information
CyberDem0n authored Feb 25, 2021
1 parent a71550f commit cc8ba10
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion postgres-appliance/major_upgrade/pg_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def analyze(self, in_stages=False):
databases = self._get_all_databases()
db_count = len([d for d in databases if d not in single_worker_dbs])
# calculate concurrency per database, except always existing "single_worker_dbs" (they'll get always 1 worker)
concurrency = str(max(1, int(psutil.cpu_count()/db_count)))
concurrency = str(max(1, int(psutil.cpu_count()/max(1, db_count))))
procs = []
for d in databases:
j = '1' if d in single_worker_dbs else concurrency
Expand Down

0 comments on commit cc8ba10

Please sign in to comment.