Skip to content

Commit

Permalink
dcache-bulk: fix faulty merge of database update
Browse files Browse the repository at this point in the history
Motivation:

See #6997

bulk in master is basically broken from:

master@cadd250f6c4c0e81f0509122ef6b2134bbec6255
https://rb.dcache.org/r/13866/

which was a faulty merge; a few of the renaming changes
which should have been applied were not, as well
as a change to the configuration of the request
builder when creating a request job.

Modification:

Make the necessary changes that should have been
there.

Result:

Bulk is working again.

Target: master
Bug: #6997
Closes: #6997
Patch: https://rb.dcache.org/r/13875/
Requires-notes:  no (unreleased)
Acked-by: Lea
  • Loading branch information
alrossi committed Feb 6, 2023
1 parent 680c358 commit 3cb4963
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Expand Up @@ -114,7 +114,7 @@ public AbstractRequestContainerJob createRequestJob(BulkRequest request)
attributes.setPnfsId(PLACEHOLDER_PNFSID);
BulkRequestTarget target = BulkRequestTargetBuilder.builder()
.activity(activity.getName())
.rid(request.getId()).pid(PID.ROOT).attributes(attributes)
.rid(request.getId()).ruid(request.getUid()).pid(PID.ROOT).attributes(attributes)
.path(ROOT_REQUEST_PATH).build();

PnfsHandler pnfsHandler = new PnfsHandler(pnfsManager);
Expand Down
Expand Up @@ -103,11 +103,11 @@ public final class JdbcBulkRequestDao extends JdbcDaoSupport {
+ "(t.state = 'CREATED' OR t.state = 'READY' OR t.state='RUNNING'))";

private static final String UPDATE_COMPLETED_IF_DONE =
"UPDATE bulk_request r SET status='COMPLETED', last_modified = ? WHERE r.uuid = ? AND "
"UPDATE bulk_request r SET status='COMPLETED', last_modified = ? WHERE r.uid = ? AND "
+ NO_UNPROCESSED_TARGETS;

private static final String UPDATE_CANCELLED_IF_DONE =
"UPDATE bulk_request r SET status='CANCELLED', last_modified = ? WHERE r.uuid = ? "
"UPDATE bulk_request r SET status='CANCELLED', last_modified = ? WHERE r.uid = ? "
+ "AND r.status='CANCELLING' AND " + NO_UNPROCESSED_TARGETS;

private JdbcBulkDaoUtils utils;
Expand Down
Expand Up @@ -111,7 +111,7 @@ static class TargetPlaceholder {

static final String SELECT = "SELECT *";

static final String JOINED_SELECT = "SELECT request_target.*, bulk_request.uuid as ruid, bulk_request.activity";
static final String JOINED_SELECT = "SELECT request_target.*, bulk_request.uid as ruid, bulk_request.activity";

static final String SECONDARY_TABLE_NAME = JdbcBulkRequestDao.TABLE_NAME;

Expand Down

0 comments on commit 3cb4963

Please sign in to comment.