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
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
491c5916
Commit
491c5916
authored
2 years ago
by
David Smith
Browse files
Options
Downloads
Patches
Plain Diff
Resolve "cta-statistics-update can fail for catalogues in postgres"
parent
e9ad586e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ReleaseNotes.md
+1
-0
1 addition, 0 deletions
ReleaseNotes.md
statistics/DatabaseStatisticsService.cpp
+8
-1
8 additions, 1 deletion
statistics/DatabaseStatisticsService.cpp
with
9 additions
and
1 deletion
ReleaseNotes.md
+
1
−
0
View file @
491c5916
...
...
@@ -12,6 +12,7 @@
-
cta/CTA#251 - Increase free drive STALE threshold to 4 hours
-
cta/CTA#218 - Do not retry during repack requests
### Bug Fixes
-
cta/CTA#181 - cta-statistics-update can fail for catalogues in postgres
-
cta/CTA#234 - Replace stoi with toUint64 in standalone cli tool
-
cta/CTA#238 - Compilation fails when using cta::common::Configuration::getConfEntInt(...)
### Continuous Integration
...
...
This diff is collapsed.
Click to expand it.
statistics/DatabaseStatisticsService.cpp
+
8
−
1
View file @
491c5916
...
...
@@ -16,6 +16,7 @@
*/
#include
<string>
#include
<vector>
#include
"DatabaseStatisticsService.hpp"
...
...
@@ -92,10 +93,16 @@ void DatabaseStatisticsService::updateStatisticsPerTape() {
try
{
auto
selectStmt
=
m_conn
.
createStmt
(
selectVids
);
auto
rset
=
selectStmt
.
executeQuery
();
// Make a list of all dirty vids. The memory required for the list is
// expected to be acceptable.
std
::
vector
<
std
::
string
>
dirtyVids
;
while
(
rset
.
next
())
{
dirtyVids
.
push_back
(
rset
.
columnString
(
"VID"
));
}
for
(
const
auto
&
vid
:
dirtyVids
)
{
// For all DIRTY tapes, update its statistics
auto
updateStmt
=
m_conn
.
createStmt
(
updateSql
);
updateStmt
.
bindString
(
":VID"
,
rset
.
columnString
(
"VID"
)
);
updateStmt
.
bindString
(
":VID"
,
vid
);
updateStmt
.
executeNonQuery
();
m_nbUpdatedTapes
+=
updateStmt
.
getNbAffectedRows
();
}
...
...
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