Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Slurm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tud-zih-energy
Slurm
Commits
3cf3180c
Commit
3cf3180c
authored
10 years ago
by
Danny Auble
Browse files
Options
Downloads
Patches
Plain Diff
Fix issue with wckeys when tracking wckeys, but not enforcing them,
you could get multiple '*' wckeys.
parent
737e58bc
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
NEWS
+2
-0
2 additions, 0 deletions
NEWS
src/plugins/accounting_storage/mysql/as_mysql_job.c
+27
-3
27 additions, 3 deletions
src/plugins/accounting_storage/mysql/as_mysql_job.c
src/plugins/accounting_storage/mysql/as_mysql_wckey.c
+4
-2
4 additions, 2 deletions
src/plugins/accounting_storage/mysql/as_mysql_wckey.c
with
33 additions
and
5 deletions
NEWS
+
2
−
0
View file @
3cf3180c
...
@@ -25,6 +25,8 @@ documents those changes that are of interest to users and admins.
...
@@ -25,6 +25,8 @@ documents those changes that are of interest to users and admins.
able to be destroyed for debug.
able to be destroyed for debug.
-- Added extra index's into the database for better performance when
-- Added extra index's into the database for better performance when
deleting users.
deleting users.
-- Fix issue with wckeys when tracking wckeys but not enforcing them you could
get multiple '*' wckeys.
* Changes in Slurm 14.03.4
* Changes in Slurm 14.03.4
==========================
==========================
...
...
This diff is collapsed.
Click to expand it.
src/plugins/accounting_storage/mysql/as_mysql_job.c
+
27
−
3
View file @
3cf3180c
...
@@ -176,6 +176,9 @@ static uint32_t _get_wckeyid(mysql_conn_t *mysql_conn, char **name,
...
@@ -176,6 +176,9 @@ static uint32_t _get_wckeyid(mysql_conn_t *mysql_conn, char **name,
NULL
)
!=
SLURM_SUCCESS
)
{
NULL
)
!=
SLURM_SUCCESS
)
{
List
wckey_list
=
NULL
;
List
wckey_list
=
NULL
;
slurmdb_wckey_rec_t
*
wckey_ptr
=
NULL
;
slurmdb_wckey_rec_t
*
wckey_ptr
=
NULL
;
/* we have already checked to make
sure this was the slurm user before
calling this */
wckey_list
=
list_create
(
slurmdb_destroy_wckey_rec
);
wckey_list
=
list_create
(
slurmdb_destroy_wckey_rec
);
...
@@ -187,9 +190,30 @@ static uint32_t _get_wckeyid(mysql_conn_t *mysql_conn, char **name,
...
@@ -187,9 +190,30 @@ static uint32_t _get_wckeyid(mysql_conn_t *mysql_conn, char **name,
/* info("adding wckey '%s' '%s' '%s'", */
/* info("adding wckey '%s' '%s' '%s'", */
/* wckey_ptr->name, wckey_ptr->user, */
/* wckey_ptr->name, wckey_ptr->user, */
/* wckey_ptr->cluster); */
/* wckey_ptr->cluster); */
/* we have already checked to make
sure this was the slurm user before
if
(
*
name
[
0
]
==
'*'
)
{
calling this */
/* make sure the non * wckey has been added */
wckey_rec
.
name
=
(
*
name
)
+
1
;
if
(
assoc_mgr_fill_in_wckey
(
mysql_conn
,
&
wckey_rec
,
ACCOUNTING_ENFORCE_WCKEYS
,
NULL
)
!=
SLURM_SUCCESS
)
{
wckey_ptr
=
xmalloc
(
sizeof
(
slurmdb_wckey_rec_t
));
wckey_ptr
->
name
=
xstrdup
(
wckey_rec
.
name
);
wckey_ptr
->
user
=
xstrdup
(
user
);
wckey_ptr
->
cluster
=
xstrdup
(
cluster
);
list_prepend
(
wckey_list
,
wckey_ptr
);
/* info("adding wckey '%s' '%s' " */
/* "'%s'", */
/* wckey_ptr->name, */
/* wckey_ptr->user, */
/* wckey_ptr->cluster); */
}
wckey_rec
.
name
=
(
*
name
);
}
if
(
as_mysql_add_wckeys
(
mysql_conn
,
if
(
as_mysql_add_wckeys
(
mysql_conn
,
slurm_get_slurm_user_id
(),
slurm_get_slurm_user_id
(),
wckey_list
)
wckey_list
)
...
...
This diff is collapsed.
Click to expand it.
src/plugins/accounting_storage/mysql/as_mysql_wckey.c
+
4
−
2
View file @
3cf3180c
...
@@ -133,9 +133,11 @@ static int _make_sure_users_have_default(
...
@@ -133,9 +133,11 @@ static int _make_sure_users_have_default(
MYSQL_RES
*
result
=
NULL
;
MYSQL_RES
*
result
=
NULL
;
MYSQL_ROW
row
;
MYSQL_ROW
row
;
char
*
wckey
=
NULL
;
char
*
wckey
=
NULL
;
/* only look at non * and non deleted ones */
query
=
xstrdup_printf
(
query
=
xstrdup_printf
(
"select distinct is_def, wckey_name from "
"select distinct is_def, wckey_name from "
"
\"
%s_%s
\"
where user='%s' FOR UPDATE;"
,
"
\"
%s_%s
\"
where user='%s' and wckey_name "
"not like '*%%' and deleted=0 FOR UPDATE;"
,
cluster
,
wckey_table
,
user
);
cluster
,
wckey_table
,
user
);
debug4
(
"%d(%s:%d) query
\n
%s"
,
debug4
(
"%d(%s:%d) query
\n
%s"
,
mysql_conn
->
conn
,
THIS_FILE
,
__LINE__
,
query
);
mysql_conn
->
conn
,
THIS_FILE
,
__LINE__
,
query
);
...
@@ -503,7 +505,7 @@ extern int as_mysql_add_wckeys(mysql_conn_t *mysql_conn, uint32_t uid,
...
@@ -503,7 +505,7 @@ extern int as_mysql_add_wckeys(mysql_conn_t *mysql_conn, uint32_t uid,
while
((
object
=
list_next
(
itr
)))
{
while
((
object
=
list_next
(
itr
)))
{
if
(
!
object
->
cluster
||
!
object
->
cluster
[
0
]
if
(
!
object
->
cluster
||
!
object
->
cluster
[
0
]
||
!
object
->
user
||
!
object
->
user
[
0
]
||
!
object
->
user
||
!
object
->
user
[
0
]
||
!
object
->
name
||
!
object
->
name
[
0
]
)
{
||
!
object
->
name
)
{
error
(
"We need a wckey name, cluster, "
error
(
"We need a wckey name, cluster, "
"and user to add."
);
"and user to add."
);
rc
=
SLURM_ERROR
;
rc
=
SLURM_ERROR
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment