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
60c40c06
Commit
60c40c06
authored
2 years ago
by
Jorge Camarero Vera
Browse files
Options
Downloads
Patches
Plain Diff
Schema verify return 2 if it fails and the schema is upgrading
parent
8300b70d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ReleaseNotes.md
+1
-0
1 addition, 0 deletions
ReleaseNotes.md
catalogue/VerifySchemaCmd.cpp
+20
-0
20 additions, 0 deletions
catalogue/VerifySchemaCmd.cpp
catalogue/VerifySchemaCmd.hpp
+8
-0
8 additions, 0 deletions
catalogue/VerifySchemaCmd.hpp
with
29 additions
and
0 deletions
ReleaseNotes.md
+
1
−
0
View file @
60c40c06
...
...
@@ -8,6 +8,7 @@
-
cta/CTA#950 - Eliminate race condition preventing the drive to go down on failure
-
cta/CTA#1160 - Fix DrainingToDisk stale status in case if there is DiskWriteThreadPool thread left
-
cta/operations#708 - Fix "Should run cleaner but VID is missing. Putting the drive down"
-
cta/CTA#1197 - Return code from
`cta-catalogue-schema-verify`
should indicate if the schema is in UPGRADING state
### Building and Packaging
### Catalogue Schema
...
...
This diff is collapsed.
Click to expand it.
catalogue/VerifySchemaCmd.cpp
+
20
−
0
View file @
60c40c06
...
...
@@ -87,6 +87,10 @@ int VerifySchemaCmd::exceptionThrowingMain(const int argc, char *const *const ar
result
+=
schemaChecker
->
warnErrorLoggingTables
();
result
+=
schemaChecker
->
warnMissingIndexes
();
result
.
displayWarnings
(
std
::
cout
);
if
(
result
.
getStatus
()
==
SchemaCheckerResult
::
Status
::
FAILED
&&
isUpgrading
(
&
conn
))
{
return
2
;
}
if
(
result
.
getStatus
()
==
SchemaCheckerResult
::
Status
::
FAILED
){
return
1
;
}
...
...
@@ -113,5 +117,21 @@ void VerifySchemaCmd::printUsage(std::ostream &os) {
VerifySchemaCmdLineArgs
::
printUsage
(
os
);
}
bool
VerifySchemaCmd
::
isUpgrading
(
rdbms
::
Conn
*
conn
)
{
const
char
*
const
sql
=
"SELECT "
"CTA_CATALOGUE.STATUS AS STATUS "
"FROM "
"CTA_CATALOGUE"
;
auto
stmt
=
conn
->
createStmt
(
sql
);
auto
rset
=
stmt
.
executeQuery
();
if
(
!
rset
.
next
())
{
throw
exception
::
Exception
(
"CTA_CATALOGUE does not contain any STATUS"
);
}
return
rset
.
columnString
(
"STATUS"
)
==
"UPGRADING"
;
}
}
// namespace catalogue
}
// namespace cta
This diff is collapsed.
Click to expand it.
catalogue/VerifySchemaCmd.hpp
+
8
−
0
View file @
60c40c06
...
...
@@ -74,6 +74,14 @@ private:
* @return True if the table exists.
*/
bool
tableExists
(
const
std
::
string
tableName
,
rdbms
::
Conn
&
conn
)
const
;
/*
* Returns true if the catalogue is upgrading
*
* @param conn The database connection
* @return True if the catalogue is upgrading
*/
bool
isUpgrading
(
rdbms
::
Conn
*
conn
);
#if 0
/**
...
...
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