Skip to content

HDDS-13625. Recon UI: Add "Replication Type" col on Bucket page - #10968

Open
stantheman0128 wants to merge 2 commits into
apache:masterfrom
stantheman0128:HDDS-13625
Open

HDDS-13625. Recon UI: Add "Replication Type" col on Bucket page#10968
stantheman0128 wants to merge 2 commits into
apache:masterfrom
stantheman0128:HDDS-13625

Conversation

@stantheman0128

Copy link
Copy Markdown

What changes were proposed in this pull request?

The Recon UI Bucket list page does not show how each bucket is replicated, so a
reader cannot tell a Ratis bucket from an EC one without looking somewhere else.

This adds a Replication Type column to that page. The bucket endpoint already
returns the information as BucketObjectDBInfo#replicationConfigInfo, a
serialized DefaultReplicationConfig, so no backend change is needed. The
frontend was not reading the field.

The column renders the replication strings Ozone uses elsewhere:

Bucket default replication Column value
Ratis, factor THREE Ratis-3
EC, RS 6-3 with 1 MB chunks RS-6-3-1024k
Standalone Standalone-1
No default replication config NA

getReplication() carries @JsonIgnore on both RatisReplicationConfig and
ECReplicationConfig, so the ready-made string does not reach the browser. The
column composes it from the fields that are serialized: requiredNodes for
Ratis and Standalone, and codec, data, parity, ecChunkSize for EC.
Sorting uses the rendered string.

The Jira description asks to reuse the themeIcon component. That component is
generalized in HDDS-13623, whose PR #9003 was closed without merging, so this
change renders plain text and does not depend on it. An icon can be layered on
top once HDDS-13623 lands.

Three of the five mock buckets in api/db.json now carry a
replicationConfigInfo, so the column can be exercised with pnpm dev. The
other two are left without one to cover the NA case.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-13625

How was this patch tested?

  • New unit tests in src/__tests__/buckets/BucketsTable.test.tsx cover Ratis,
    EC, Standalone, a config that carries only the outer type, and the
    undefined and null cases. npx vitest run reports 74 passing tests with
    one pre-existing skip.
  • npx vite build succeeds.
  • npx eslint on the touched files reports no warning that is not already
    present on the same files before the change.
  • Manually checked against the mock API with pnpm dev. The five mock buckets
    cover all four rendered forms:

Recon Bucket page showing the Replication Type column

  • build-branch workflow run on the fork:
    https://github.com/stantheman0128/ozone/actions/runs/31186914918
    43 of the 44 jobs pass. The kubernetes job fails on the fork runner across
    all three attempts because the minikube cluster never leaves safe mode:
    HealthyPipelineSafeModeRule reports a pipeline count of 0, so no datanode
    pipeline forms. The Recon pod itself starts normally in those runs.

Generated-by: Claude Code (claude-opus-5)

Show the default replication of each bucket on the Recon Bucket list
page. The bucket endpoint already returns this as
BucketObjectDBInfo#replicationConfigInfo, so no backend change is
needed.

The column renders the replication strings Ozone uses elsewhere:
Ratis-3 for Ratis buckets, RS-6-3-1024k for EC buckets, Standalone-1
for single replica buckets, and NA when a bucket carries no default
replication config. Sorting follows the rendered string.

Three of the five mock buckets in api/db.json gain a
replicationConfigInfo so the column can be exercised locally with
pnpm dev.

The column is plain text rather than the themeIcon component named in
the JIRA description, because the change that generalizes themeIcon
(HDDS-13623) has not been merged. The icon can be added on top later.
Copilot AI lite review requested due to automatic review settings August 7, 2026 18:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Recon UI bucket list (v2) to display each bucket’s default replication as a new “Replication Type” column, using the existing replicationConfigInfo already returned by the Recon bucket endpoint (no backend changes).

Changes:

  • Extend bucket types to include replicationConfigInfo (serialized DefaultReplicationConfig).
  • Plumb replicationConfigInfo through the buckets page data mapping and render/sort the new table column via a formatted replication string.
  • Add UI unit tests covering the new column’s rendering and update mock API data (api/db.json) to exercise the column.

Reviewed changes

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

Show a summary per file
File Description
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/types/bucket.types.ts Add TypeScript types for replicationConfigInfo and extend Bucket with the new field.
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/pages/buckets/buckets.tsx Include replicationConfigInfo when mapping API buckets into UI buckets.
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/components/tables/bucketsTable.tsx Add “Replication Type” column and formatting/sorting logic.
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/tests/buckets/BucketsTable.test.tsx Add unit tests for the new column formatting and fallbacks.
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/api/db.json Add replicationConfigInfo to several mock buckets to exercise the column in dev.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +42 to +46
type BucketRatisReplicationConfig = {
replicationType: 'RATIS' | 'STAND_ALONE';
replicationFactor: string;
requiredNodes: number;
}
Comment on lines +82 to +85
const REPLICATION_TYPE_LABELS: Record<string, string> = {
RATIS: 'Ratis',
STAND_ALONE: 'Standalone'
};
Comment on lines +103 to +119
test('renders the Standalone variant for a single replica bucket', () => {
render(
<BucketsTable
{...defaultProps}
data={[getBucketWith('standalone-bucket', {
type: 'STAND_ALONE',
replicationConfig: {
replicationType: 'STAND_ALONE',
replicationFactor: 'ONE',
requiredNodes: 1
}
})]}
/>
);

expect(screen.getByText('Standalone-1')).toBeInTheDocument();
});
StandaloneReplicationConfig serializes replicationType as STANDALONE,
without the underscore, while the ReplicationType enum name used
elsewhere is STAND_ALONE. A Standalone bucket therefore reached the
column as STANDALONE and rendered as STANDALONE-1 instead of
Standalone-1.

Map both spellings, widen the type accordingly, and cover each spelling
with its own test. The mock bucket in api/db.json now uses the spelling
the backend actually emits.
@sarvekshayr
sarvekshayr requested a review from spacemonkd August 10, 2026 10:53

@chihsuan chihsuan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the patch! @stantheman0128 Overall, looks good. I tested this on local mock site and verified form renders the column as described.

I left a few inline comments, mainly around the EC string and a type we could reuse.

const replicationConfig = replicationConfigInfo?.replicationConfig;
if (replicationConfig?.replicationType === 'EC') {
const { codec, data, parity, ecChunkSize } = replicationConfig;
return `${codec}-${data}-${parity}-${Math.floor(ecChunkSize / 1024)}k`;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Minor: Ozone itself prints rs-6-3-1024k (lowercase) everywhere else. Would it make sense to use codec.toLowerCase() here for consistency?

// and StandaloneReplicationConfig. The latter serializes its replicationType as
// STANDALONE, while the enum name used elsewhere is STAND_ALONE, so both spellings
// can reach the UI.
type BucketRatisReplicationConfig = {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These Ratis and EC response shapes are already defined as RatisInfo, EcInfo, and ReplicationInfo in insights.types.ts.

Could we add a StandaloneInfo variant there and reuse the shared ReplicationInfo here? That would avoid duplicating the serialized ReplicationConfig contract and would also include the backend’s minimumNodes field.

STANDALONE: 'Standalone'
};

// Mirrors the replication strings Ozone uses elsewhere, e.g. Ratis-3 and RS-6-3-1024k

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: Ozone uses formats such as RATIS/THREE and rs-6-3-1024k elsewhere, rather than Ratis-3 and uppercase RS-.... Perhaps change it to a local description such as "Formats the bucket’s default replication configuration for display."?

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.

3 participants