Skip to content

fw: implement cs/erase management command - #205

Open
Harsh23Kashyap wants to merge 1 commit into
named-data:mainfrom
Harsh23Kashyap:fix/fw-cs-erase
Open

fw: implement cs/erase management command#205
Harsh23Kashyap wants to merge 1 commit into
named-data:mainfrom
Harsh23Kashyap:fix/fw-cs-erase

Conversation

@Harsh23Kashyap

Copy link
Copy Markdown

Closes #196

cs/erase previously went unanswered because the content-store module had no handler for it. This adds one, mirroring NFD:

  • decodes the prefix from ControlParameters in the command name
  • erases matching entries on every forwarding thread
  • caps a single command at 256 erasures, matching NFD's erase limit; clients repeat the command for the remainder
  • replies with a control response carrying the number of entries erased

Adds unit tests for the tree erase and the handler. go build ./... and go test ./fw/... pass.

Implements the cs/erase management command (closes named-data#196), which was
previously stubbed out. Erases Content Store entries under the prefix
given in ControlParameters.Name on every forwarding thread, honoring
the optional Count parameter and capping a single command at 256
entries like NFD's ERASE_LIMIT.

The CS is sharded per forwarding thread and guarded by a same-goroutine
contract, so the management module fans the request out through a
per-thread channel that the forwarding goroutine services from its
select loop. The response reports the number of entries erased and
sets Capacity when more entries remain, matching NFD's signaling.
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.

[fw] cs/erase command returns no response

1 participant