Skip to content

[8.0] Replace BLOBs with TEXTs for JobDB and PilotAgentsDB#5840

Merged
chrisburr merged 6 commits into
DIRACGrid:integrationfrom
fstagni:80_removeBLOB_WMS
Feb 18, 2022
Merged

[8.0] Replace BLOBs with TEXTs for JobDB and PilotAgentsDB#5840
chrisburr merged 6 commits into
DIRACGrid:integrationfrom
fstagni:80_removeBLOB_WMS

Conversation

@fstagni

@fstagni fstagni commented Jan 28, 2022

Copy link
Copy Markdown
Contributor

resolves #5253

BEGINRELEASENOTES

*WMS
CHANGE: Replace BLOBs with TEXTs for JobDB and PilotAgentsDB

ENDRELEASENOTES

`JobID` INT(11) UNSIGNED NOT NULL,
`Name` VARCHAR(100) NOT NULL,
`Value` BLOB NOT NULL,
`Value` TEXT NOT NULL,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you've picked up a tab here:

Suggested change
`Value` TEXT NOT NULL,
`Value` TEXT NOT NULL,

for site, status, lastUpdateTime, author, comment in result["Value"]:
siteDict[site] = status, lastUpdateTime, author, comment.decode()
try:
comment = comment.decode()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
comment = comment.decode()
# TODO: This is only needed in DIRAC v8.0.x while moving from BLOB -> TEXT
comment = comment.decode()

I would also be tempted to do an if isinstance(comment, bytes): here but it's up to you.

site, status, lastUpdate, author, comment = resSite["Value"][0]
resultDict[site] = [[status, str(lastUpdate), author, comment.decode()]]
try:
comment = comment.decode()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

resultDict[site] = []
resultDict[site].append([status, str(utime), author, comment.decode()])
try:
comment = comment.decode()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here

result = self._update(req)
if not result["OK"]:
return S_ERROR("Failed to set the heart beat time: " + result["Message"])
return S_ERROR(f"Failed to set the heart beat time: " + result["Message"])

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you made this an f-string I presume you meant:

Suggested change
return S_ERROR(f"Failed to set the heart beat time: " + result["Message"])
return S_ERROR(f"Failed to set the heart beat time: {result['Message']}")

delTime = ret["Value"]

self.log.verbose("Removing HeartBeatLogginInfo for", "%r %r %r" % (status, delTime, maxLines))
self.log.verbose("Removing HeartBeatLogginInfo for", f"{status} {delTime} {maxLines}")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to keep the use if repr here?

Suggested change
self.log.verbose("Removing HeartBeatLogginInfo for", f"{status} {delTime} {maxLines}")
self.log.verbose("Removing HeartBeatLogginInfo for", f"{status!r} {delTime!r} {maxLines!r}")

@chrisburr chrisburr merged commit 0df8091 into DIRACGrid:integration Feb 18, 2022
@DIRACGridBot DIRACGridBot added the sweep:ignore Prevent sweeping from being ran for this PR label Feb 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sweep:ignore Prevent sweeping from being ran for this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Do not use BLOB in JobsDB and PilotAgentsDB tables

3 participants