View | Details | Raw Unified | Return to ticket 5086 | Differences between
and this patch

Collapse All | Expand All

(-)a/src/plugins/accounting_storage/mysql/as_mysql_archive.c (+5 lines)
Lines 43-48 Link Here
43
#include <unistd.h>
43
#include <unistd.h>
44
44
45
#include "as_mysql_archive.h"
45
#include "as_mysql_archive.h"
46
#include "as_mysql_usage.h"
46
#include "src/common/env.h"
47
#include "src/common/env.h"
47
#include "src/common/slurm_time.h"
48
#include "src/common/slurm_time.h"
48
#include "src/common/slurmdbd_defs.h"
49
#include "src/common/slurmdbd_defs.h"
Lines 3188-3193 static int _archive_purge_table(purge_type_t purge_type, uint32_t usage_info, Link Here
3188
				return rc;
3189
				return rc;
3189
		}
3190
		}
3190
3191
3192
		slurm_mutex_lock(&rollup_lock);
3191
		switch (purge_type) {
3193
		switch (purge_type) {
3192
		case PURGE_TXN:
3194
		case PURGE_TXN:
3193
			query = xstrdup_printf(
3195
			query = xstrdup_printf(
Lines 3231-3242 static int _archive_purge_table(purge_type_t purge_type, uint32_t usage_info, Link Here
3231
		if (rc != SLURM_SUCCESS) {
3233
		if (rc != SLURM_SUCCESS) {
3232
			error("Couldn't remove old data from %s table",
3234
			error("Couldn't remove old data from %s table",
3233
			      sql_table);
3235
			      sql_table);
3236
			slurm_mutex_unlock(&rollup_lock);
3234
			return SLURM_ERROR;
3237
			return SLURM_ERROR;
3235
		} else if (mysql_db_commit(mysql_conn)) {
3238
		} else if (mysql_db_commit(mysql_conn)) {
3236
			error("Couldn't commit cluster (%s) purge",
3239
			error("Couldn't commit cluster (%s) purge",
3237
			      cluster_name);
3240
			      cluster_name);
3241
			slurm_mutex_unlock(&rollup_lock);
3238
			break;
3242
			break;
3239
		}
3243
		}
3244
		slurm_mutex_unlock(&rollup_lock);
3240
	} while (tmp_end < curr_end);
3245
	} while (tmp_end < curr_end);
3241
3246
3242
	return SLURM_SUCCESS;
3247
	return SLURM_SUCCESS;
(-)a/src/plugins/accounting_storage/mysql/as_mysql_job.c (+8 lines)
Lines 512-517 no_rollup_change: Link Here
512
	else if (job_ptr->partition)
512
	else if (job_ptr->partition)
513
		partition = job_ptr->partition;
513
		partition = job_ptr->partition;
514
514
515
	slurm_mutex_lock(&rollup_lock);
515
	if (!job_ptr->db_index) {
516
	if (!job_ptr->db_index) {
516
		if (start_time && (job_state >= JOB_COMPLETE) &&
517
		if (start_time && (job_state >= JOB_COMPLETE) &&
517
		    (!job_ptr->tres_alloc_str &&
518
		    (!job_ptr->tres_alloc_str &&
Lines 785-790 no_rollup_change: Link Here
785
			as_mysql_suspend(mysql_conn, job_db_inx, job_ptr);
786
			as_mysql_suspend(mysql_conn, job_db_inx, job_ptr);
786
	}
787
	}
787
end_it:
788
end_it:
789
	slurm_mutex_unlock(&rollup_lock);
788
	xfree(tres_alloc_str);
790
	xfree(tres_alloc_str);
789
	xfree(block_id);
791
	xfree(block_id);
790
	xfree(query);
792
	xfree(query);
Lines 1050-1056 extern int as_mysql_job_complete(mysql_conn_t *mysql_conn, Link Here
1050
1052
1051
	if (debug_flags & DEBUG_FLAG_DB_JOB)
1053
	if (debug_flags & DEBUG_FLAG_DB_JOB)
1052
		DB_DEBUG(mysql_conn->conn, "query\n%s", query);
1054
		DB_DEBUG(mysql_conn->conn, "query\n%s", query);
1055
	slurm_mutex_lock(&rollup_lock);
1053
	rc = mysql_db_query(mysql_conn, query);
1056
	rc = mysql_db_query(mysql_conn, query);
1057
	slurm_mutex_unlock(&rollup_lock);
1054
	xfree(query);
1058
	xfree(query);
1055
end_it:
1059
end_it:
1056
	xfree(tres_alloc_str);
1060
	xfree(tres_alloc_str);
Lines 1211-1217 extern int as_mysql_step_start(mysql_conn_t *mysql_conn, Link Here
1211
		step_ptr->tres_alloc_str);
1215
		step_ptr->tres_alloc_str);
1212
	if (debug_flags & DEBUG_FLAG_DB_STEP)
1216
	if (debug_flags & DEBUG_FLAG_DB_STEP)
1213
		DB_DEBUG(mysql_conn->conn, "query\n%s", query);
1217
		DB_DEBUG(mysql_conn->conn, "query\n%s", query);
1218
	slurm_mutex_lock(&rollup_lock);
1214
	rc = mysql_db_query(mysql_conn, query);
1219
	rc = mysql_db_query(mysql_conn, query);
1220
	slurm_mutex_unlock(&rollup_lock);
1215
	xfree(query);
1221
	xfree(query);
1216
1222
1217
	return rc;
1223
	return rc;
Lines 1410-1415 extern int as_mysql_step_complete(mysql_conn_t *mysql_conn, Link Here
1410
		   step_ptr->job_ptr->db_index, step_ptr->step_id);
1416
		   step_ptr->job_ptr->db_index, step_ptr->step_id);
1411
	if (debug_flags & DEBUG_FLAG_DB_STEP)
1417
	if (debug_flags & DEBUG_FLAG_DB_STEP)
1412
		DB_DEBUG(mysql_conn->conn, "query\n%s", query);
1418
		DB_DEBUG(mysql_conn->conn, "query\n%s", query);
1419
	slurm_mutex_lock(&rollup_lock);
1413
	rc = mysql_db_query(mysql_conn, query);
1420
	rc = mysql_db_query(mysql_conn, query);
1414
	xfree(query);
1421
	xfree(query);
1415
1422
Lines 1426-1431 extern int as_mysql_step_complete(mysql_conn_t *mysql_conn, Link Here
1426
		rc = mysql_db_query(mysql_conn, query);
1433
		rc = mysql_db_query(mysql_conn, query);
1427
		xfree(query);
1434
		xfree(query);
1428
	}
1435
	}
1436
	slurm_mutex_unlock(&rollup_lock);
1429
1437
1430
	return rc;
1438
	return rc;
1431
}
1439
}

Return to ticket 5086