Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cta
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dCache
cta
Commits
934fbbfc
Commit
934fbbfc
authored
11 years ago
by
Steven Murray
Browse files
Options
Downloads
Patches
Plain Diff
bug #103710: RFE: vmgr should always choose the tape with the least free space for writing
Fixed in the v2_1_14Version branch.
parent
6daab363
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
vmgr/vmgr_oracle_ifce.pc
+2
-45
2 additions, 45 deletions
vmgr/vmgr_oracle_ifce.pc
with
2 additions
and
45 deletions
vmgr/vmgr_oracle_ifce.pc
+
2
−
45
View file @
934fbbfc
...
...
@@ -726,9 +726,8 @@ int vmgr_get_side_by_size_byte_u64(struct vmgr_dbfd *dbfd,
struct sqlca sqlca;
char estimated_free_space_byte_str[21];
/* Try to find the five tapes with the least amount of free space that have */
/* enough space to satisfy the specified request size, then pick one of */
/* those tapes at random. */
/* Find the five tapes with the least amount of free space and pick one */
/* of them at random */
EXEC SQL DECLARE tape_size_cursor4upd CURSOR FOR
SELECT ROWID, vid, side, poolname, status, TO_CHAR(estimated_free_space),
nbfiles
...
...
@@ -749,41 +748,12 @@ int vmgr_get_side_by_size_byte_u64(struct vmgr_dbfd *dbfd,
AND vmgr_tape_library.status = 0
AND vmgr_tape_side.poolname = :poolname
AND vmgr_tape_side.status = 0
AND vmgr_tape_side.estimated_free_space >= :reqsize
ORDER BY vmgr_tape_side.estimated_free_space asc, DBMS_RANDOM.VALUE)
WHERE rownum <= 5)
ORDER BY DBMS_RANDOM.VALUE)
WHERE ROWNUM < 2)
FOR UPDATE;
/* Try to find the five tapes with the most amount of free space and then */
/* choose one of them at random */
EXEC SQL DECLARE tape_maxsize_cursor4upd CURSOR FOR
SELECT ROWID, vid, side, poolname, status, TO_CHAR(estimated_free_space),
nbfiles
FROM vmgr_tape_side
WHERE
vmgr_tape_side.vid = (
SELECT vid
FROM (
SELECT vid
FROM (
SELECT vid
FROM (
SELECT vmgr_tape_side.vid
FROM vmgr_tape_side, vmgr_tape_info, vmgr_tape_library
WHERE
vmgr_tape_side.vid = vmgr_tape_info.vid
AND vmgr_tape_info.library = vmgr_tape_library.name
AND vmgr_tape_library.status = 0
AND vmgr_tape_side.poolname = :poolname
AND vmgr_tape_side.status = 0
ORDER BY vmgr_tape_side.estimated_free_space desc, DBMS_RANDOM.VALUE)
WHERE rownum <= 5)
ORDER BY DBMS_RANDOM.VALUE)
WHERE ROWNUM < 2)
FOR UPDATE;
strncpy (func, "vmgr_get_tape_by_size", 22);
EXEC SQL OPEN tape_size_cursor4upd;
if (sqlca.sqlcode) {
...
...
@@ -795,19 +765,6 @@ int vmgr_get_side_by_size_byte_u64(struct vmgr_dbfd *dbfd,
:side_entry->vid, :side_entry->side, :side_entry->poolname,
:side_entry->status, :estimated_free_space_byte_str,
:side_entry->nbfiles;
/* If no data was found */
if (sqlca.sqlcode == 1403) {
EXEC SQL OPEN tape_maxsize_cursor4upd;
if (sqlca.sqlcode) {
vmgr_oracle_error (func, "OPEN CURSOR", dbfd, &sqlca);
return (-1);
}
EXEC SQL FETCH tape_maxsize_cursor4upd INTO
:rowid_value,
:side_entry->vid, :side_entry->side, :side_entry->poolname,
:side_entry->status, :estimated_free_space_byte_str,
:side_entry->nbfiles;
}
switch (sqlca.sqlcode) {
case 0:
if (lock)
...
...
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