Skip to content

Add efficient DFSFileRename service bypassing DFU workunit overhead#167

Draft
Copilot wants to merge 2 commits intomasterfrom
copilot/add-dfuplus-dfsrename-option
Draft

Add efficient DFSFileRename service bypassing DFU workunit overhead#167
Copilot wants to merge 2 commits intomasterfrom
copilot/add-dfuplus-dfsrename-option

Conversation

Copy link

Copilot AI commented Jan 30, 2026

The existing dfuplus rename operation creates a DFU workunit via the spray service for each rename. This PR adds a direct rename path using CDistributedFileDirectory::renamePhysical().

Changes

New WsDfu service method: DFSFileRename (v1.68)

  • ESDL interface (esp/scm/ws_dfu.ecm):
    • DFSFileRenameItem: {OldName, NewName}
    • DFSFileRenameRequest: array of rename items
    • DFSFileRenameResult: {OldName, NewName, Success, Message}
  • Implementation (esp/services/ws_dfu/ws_dfuService.cpp):
    • Calls queryDistributedFileDirectory().renamePhysical() directly
    • Per-file exception handling and result tracking
    • Requires DfuAccess:WRITE permission

New dfuplus action: dfsrename

  • Location: dali/dfuplus/dfuplus.{hpp,cpp}, main.cpp
  • Supports single and batch operations:
    # Single file
    dfuplus action=dfsrename oldname=file::old newname=file::new ...
    
    # Batch
    dfuplus action=dfsrename oldname1=a::old newname1=a::new \
                             oldname2=b::old newname2=b::new ...
  • Returns individual success/failure status per file

Technical Notes

  • Batch support allows multiple renames in single service call
  • Old rename action remains unchanged (uses spray service)
  • New approach eliminates workunit creation and spray service intermediary
  • Service version incremented: 1.67 → 1.68

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • downloads.apache.org
    • Triggering command: /usr/bin/curl curl --fail --retry 3 -L REDACTED --create-dirs --output apr-1.7.6.tar.bz2.7788.part -H User-Agent: vcpkg/2025-09-03-4580816534ed8fd9634ac83d46471440edd82dfe (curl) -D nm_�� conftest.nm rees/38.vcpkg_de-o tnet/tools/as 64-linux-dynamic/include /HPCC-Platform/b-I atform/HPCC-Plat. cat (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

The dfuplus rename service talks to the spray service to perform the rename, which in turn creates a dfu workunit to do the rename - this is extremely inefficient.

Add a new service call to WsDfu that handles rename, which accepts a list of {oldname, newname} to rename multiple files, and then uses CDistributedFileDirectory::renamePhysical directly to rename these files, captures the success and returns the results to the client caller.

And extend dfuplus with a dfsrename option that uses this service.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: jakesmith <902700+jakesmith@users.noreply.github.com>
Copilot AI changed the title [WIP] Add efficient rename service in WsDfu for multiple files Add efficient DFSFileRename service bypassing DFU workunit overhead Jan 30, 2026
Copilot AI requested a review from jakesmith January 30, 2026 16:37
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.

2 participants