Skip to content

pool: New hotfile show command, and show enablement status with info -a#8067

Open
greenc-FNAL wants to merge 1 commit into11.2from
fix/11.2/RB-14640
Open

pool: New hotfile show command, and show enablement status with info -a#8067
greenc-FNAL wants to merge 1 commit into11.2from
fix/11.2/RB-14640

Conversation

@greenc-FNAL
Copy link
Copy Markdown
Contributor

Motivation:

It is desirable to have a single admin command to display the values of both hot-file migration parameters (replicas and threshold).

It is also desirable to see quickly whether the hot file migration facility is enabled on a given pool.

Modification:

  • The addition of a pool command hotfile show to MigrationModule
  • The hot file replication enablement status has been added to the pool section of info -a

Result:

  • hotfile show

    replicas=3  threshold=5
    
  • info -a

    …
    --- pool (Main pool component) ---
    Base directory       : /diska/rw-pool-1
    Version              : 12.0.0-SNAPSHOT(bddeaa4) (Sub=4)
    Report remove        : ON
    Pool Mode            : enabled
    Hsm Load Suppression : OFF
    Ping Heartbeat       : 30 seconds
    Breakeven            : 0.7
    LargeFileStore       : NONE
    P2P File Mode        : CACHED
    Hot File Replication : ON
    Mover Queue (DCap) 0(100)/0
    Mover Queue (FTP) 0(30)/0
    Mover Queue (TPC) 0(1000)/0
    Mover Queue (XRootD) 0(1000)/0
    Mover Queue (HTTP) 0(1000)/0
    Mover Queue (NFS) 0(1000)/0
    Mover Queue (regular) 0(1000)/0
    Mover Queue (CVMFS) 0(10000)/0
    …
    

Acked-by: Dmitry Litvintsev
Patch: https://rb.dcache.org/r/14640/diff/raw
Commit:
Target: master
Request: 11.2
Require-book: no
Require-notes: yes

…fo -a`

Motivation:

It is desirable to have a single admin command to display the values of both hot-file migration parameters (`replicas` and `threshold`).

It is also desirable to see quickly whether the hot file migration facility is enabled on a given pool.

Modification:

- The addition of a pool command `hotfile show` to `MigrationModule`
- The hot file replication enablement status has been added to the `pool` section of `info -a`

Result:

- `hotfile show`

    ```
    replicas=3  threshold=5
    ```

- `info -a`

    ```
    …
    --- pool (Main pool component) ---
    Base directory       : /diska/rw-pool-1
    Version              : 12.0.0-SNAPSHOT(bddeaa4) (Sub=4)
    Report remove        : ON
    Pool Mode            : enabled
    Hsm Load Suppression : OFF
    Ping Heartbeat       : 30 seconds
    Breakeven            : 0.7
    LargeFileStore       : NONE
    P2P File Mode        : CACHED
    Hot File Replication : ON
    Mover Queue (DCap) 0(100)/0
    Mover Queue (FTP) 0(30)/0
    Mover Queue (TPC) 0(1000)/0
    Mover Queue (XRootD) 0(1000)/0
    Mover Queue (HTTP) 0(1000)/0
    Mover Queue (NFS) 0(1000)/0
    Mover Queue (regular) 0(1000)/0
    Mover Queue (CVMFS) 0(10000)/0
    …
    ```

Acked-by: Dmitry Litvintsev
Patch: https://rb.dcache.org/r/14640/diff/raw
Commit:
Target: master
Request: 11.2
Require-book: no
Require-notes: yes
Copilot AI review requested due to automatic review settings April 7, 2026 22:04
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds improved admin visibility into hot-file replication by introducing a consolidated hotfile show command and surfacing hot-file replication enablement in info -a pool details.

Changes:

  • Added hotfile show admin command to display hot-file replication parameters (replicas, threshold).
  • Extended pool “details” output (info -a) to include “Hot File Replication : ON|OFF”.
  • Added a unit test to verify the pool details output includes the hot-file replication status line.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
modules/dcache/src/main/java/org/dcache/pool/migration/MigrationModule.java Adds hotfile show command to display hot-file replication parameters.
modules/dcache/src/main/java/org/dcache/pool/json/PoolDataDetails.java Adds hot-file replication enabled flag and prints it in pool details output (plus aligns labels).
modules/dcache/src/main/java/org/dcache/pool/classic/PoolV4.java Populates PoolDataDetails with the pool’s hot-file replication enablement state.
modules/dcache/src/test/java/org/dcache/pool/json/PoolDataDetailsTest.java New test verifying the printed pool details includes hot-file replication status.

Comment on lines +1638 to +1648
@Command(name = "hotfile show",
description = "Show the current status of the hot-file replication facility, "
+ "including whether it is enabled and the values of the 'replicas' "
+ "and 'threshold' parameters.",
hint = "Show hot-file replication status.")
public class HotfileShowCommand implements Callable<String> {

@Override
public String call() {
return "replicas=" + hotFileReplicaCount + " threshold=" + hotFileThreshold;
}
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

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

The @Command description claims this command shows whether hot-file replication is enabled, but the call() output only includes replicas and threshold. Either include the enablement state in the output (and obtain it from the appropriate component) or update the command description/hint to match what is actually returned.

Copilot uses AI. Check for mistakes.
Comment on lines +20 to +27
assertTrue("Output should contain Hot File Replication status", output.contains("Hot File Replication : ON"));

details.setHotFileReplicationEnabled(false);
sw = new StringWriter();
pw = new PrintWriter(sw);
details.print(pw);
output = sw.toString();
assertTrue("Output should contain HotFile Replication status", output.contains("Hot File Replication : OFF"));
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

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

The assertion messages have inconsistent wording and extra whitespace (e.g., double spaces and "Hotfile" vs "Hot File"). Cleaning these up will make failures easier to read and avoids introducing typos into the test suite.

Suggested change
assertTrue("Output should contain Hot File Replication status", output.contains("Hot File Replication : ON"));
details.setHotFileReplicationEnabled(false);
sw = new StringWriter();
pw = new PrintWriter(sw);
details.print(pw);
output = sw.toString();
assertTrue("Output should contain HotFile Replication status", output.contains("Hot File Replication : OFF"));
assertTrue("Output should contain Hot File Replication status", output.contains("Hot File Replication : ON"));
details.setHotFileReplicationEnabled(false);
sw = new StringWriter();
pw = new PrintWriter(sw);
details.print(pw);
output = sw.toString();
assertTrue("Output should contain Hot File Replication status", output.contains("Hot File Replication : OFF"));

Copilot uses AI. Check for mistakes.
Comment on lines +16 to +25
PrintWriter pw = new PrintWriter(sw);
details.print(pw);

String output = sw.toString();
assertTrue("Output should contain Hot File Replication status", output.contains("Hot File Replication : ON"));

details.setHotFileReplicationEnabled(false);
sw = new StringWriter();
pw = new PrintWriter(sw);
details.print(pw);
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

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

PrintWriter is never flushed/closed in this test. While StringWriter typically works without it, explicitly flushing (or using try-with-resources) makes the test more robust and avoids subtle issues if the implementation changes.

Suggested change
PrintWriter pw = new PrintWriter(sw);
details.print(pw);
String output = sw.toString();
assertTrue("Output should contain Hot File Replication status", output.contains("Hot File Replication : ON"));
details.setHotFileReplicationEnabled(false);
sw = new StringWriter();
pw = new PrintWriter(sw);
details.print(pw);
try (PrintWriter pw = new PrintWriter(sw)) {
details.print(pw);
}
String output = sw.toString();
assertTrue("Output should contain Hot File Replication status", output.contains("Hot File Replication : ON"));
details.setHotFileReplicationEnabled(false);
sw = new StringWriter();
try (PrintWriter pw = new PrintWriter(sw)) {
details.print(pw);
}

Copilot uses AI. Check for mistakes.
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