Commit cf048aea authored by Klaus Aehlig's avatar Klaus Aehlig
Browse files

Add parameter max_running_jobs to the cluster configuration



This cluster-wide parameter will determine how many non-finalized jobs maximally
should be in a not queued state at the same time.
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarPetr Pudlak <pudlak@google.com>
parent cb8028f3
......@@ -1577,6 +1577,7 @@ class Cluster(TaggableObject):
"disk_state_static",
"enabled_disk_templates",
"candidate_certs",
"max_running_jobs",
] + _TIMESTAMPS + _UUID
def UpgradeConfig(self):
......@@ -1702,6 +1703,9 @@ class Cluster(TaggableObject):
if self.candidate_certs is None:
self.candidate_certs = {}
if self.max_running_jobs is None:
self.max_running_jobs = constants.LUXID_MAXIMAL_RUNNING_JOBS_DEFAULT
@property
def primary_hypervisor(self):
"""The first hypervisor is the primary.
......
......@@ -3958,6 +3958,12 @@ luxidJobqueuePollInterval = 307
luxidMaximalRunningJobs :: Int
luxidMaximalRunningJobs = 20
-- | The default value for the maximal number of jobs to be running at the same
-- time. Once the maximal number is reached, new jobs will just be queued and
-- only started, once some of the other jobs have finished.
luxidMaximalRunningJobsDefault :: Int
luxidMaximalRunningJobsDefault = 20
-- * Confd
confdProtocolVersion :: Int
......
......@@ -706,6 +706,7 @@ $(buildObject "Cluster" "cluster" $
, simpleField "ipolicy" [t| FilledIPolicy |]
, simpleField "enabled_disk_templates" [t| [DiskTemplate] |]
, simpleField "candidate_certs" [t| CandidateCertificates |]
, simpleField "max_running_jobs" [t| Int |]
]
++ timeStampFields
++ uuidFields
......
......@@ -414,6 +414,8 @@ def DowngradeCluster(config_data):
for param in ["gluster", "gluster_storage_dir"]:
if param in cluster:
del cluster[param]
if "max_running_jobs" in cluster:
del cluster["max_running_jobs"]
def DowngradeGroups(config_data):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment