Skip to content

frontend: send a billing record when a file is deleted - #8299

Open
chubnastia wants to merge 1 commit into
12.0from
issue8246-12.0
Open

chubnastia wants to merge 1 commit into
12.0from
issue8246-12.0

Conversation

@chubnastia

Copy link
Copy Markdown
Contributor

Motivation:
Files and links deleted through the REST API (and so through dCacheView) get no remove record in billing, unlike in the other doors.

Modification:

  • The delete asks PnfsManager for the PNFS ID, type and size of the deleted entry.
  • FileResources then sends a remove DoorRequestInfoMessage to the billing topic, with the path, PNFS ID, size, client, client chain and its cell address (via CellIdentityAware). Directories are not billed, as in the other doors. A failure to send is logged and does not fail the delete.
  • The record names the requesting user, even when an admin deletes with the admin role and the delete runs as root.
  • New property frontend.service.billing.topic (default BillingTopic), checked in frontend.batch and used by a new CellStub in frontend.xml. The existing frontend.service.billing is the billing queue, used for reading billing data.
  • Add FileResourcesTest.

Result:
Deletes through the REST API and dCacheView show up in billing.

Fixes: #8246
Target: master, 12.1, 12.0, 11.2
Require-book: no
Require-notes: yes
Acked-by: Tigran Mkrtchyan
The test uses Subject.doAs, as this branch builds for Java 17. (cherry picked from commit 07549a4)

Motivation:
Files and links deleted through the REST API (and so through
dCacheView) get no `remove` record in billing, unlike in the other
doors.

Modification:
- The delete asks PnfsManager for the PNFS ID, type and size of the
  deleted entry.
- FileResources then sends a `remove` DoorRequestInfoMessage to the
  billing topic, with the path, PNFS ID, size, client, client chain
  and its cell address (via CellIdentityAware). Directories are not
  billed, as in the other doors. A failure to send is logged and
  does not fail the delete.
- The record names the requesting user, even when an admin deletes
  with the admin role and the delete runs as root.
- New property frontend.service.billing.topic (default BillingTopic),
  checked in frontend.batch and used by a new CellStub in
  frontend.xml. The existing frontend.service.billing is the billing
  queue, used for reading billing data.
- Add FileResourcesTest.

Result:
Deletes through the REST API and dCacheView show up in billing.

Fixes: #8246
Target: master, 12.1, 12.0, 11.2
Require-book: no
Require-notes: yes
Acked-by: Tigran Mkrtchyan
The test uses Subject.doAs, as this branch builds for Java 17.
(cherry picked from commit 07549a4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant