This is an automated email from the ASF dual-hosted git repository.
github-bot pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/ozone-site.git
The following commit(s) were added to refs/heads/asf-site by this push:
new ba5cb771 [auto] Generated docs from Apache Ozone master
8e8c432bb7e893d140926fb7df4f316ac9265cbe
ba5cb771 is described below
commit ba5cb771c986fa7b0681c1c8cf0ec2bdf583d110
Author: Github Actions <[email protected]>
AuthorDate: Mon Jun 2 12:46:43 2025 +0000
[auto] Generated docs from Apache Ozone master
8e8c432bb7e893d140926fb7df4f316ac9265cbe
---
docs/edge/en/sitemap.xml | 3 +
docs/edge/index.xml | 7 +
docs/edge/sitemap.xml | 2 +-
docs/edge/tools.html | 41 +-
docs/edge/tools/containerlogparser.html | 749 ++++++++++++++++++++++++++++++++
docs/edge/tools/index.xml | 9 +-
6 files changed, 799 insertions(+), 12 deletions(-)
diff --git a/docs/edge/en/sitemap.xml b/docs/edge/en/sitemap.xml
index dac748e1..0e3f09ae 100644
--- a/docs/edge/en/sitemap.xml
+++ b/docs/edge/en/sitemap.xml
@@ -609,6 +609,9 @@
hreflang="en"
href="/start/fromsource.html"
/>
+ </url><url>
+ <loc>/tools/containerlogparser.html</loc>
+ <lastmod>2025-06-02T13:47:02+05:30</lastmod>
</url><url>
<loc>/design.html</loc>
<lastmod>2025-05-28T10:07:28+05:30</lastmod>
diff --git a/docs/edge/index.xml b/docs/edge/index.xml
index 134bd116..3b1c589c 100644
--- a/docs/edge/index.xml
+++ b/docs/edge/index.xml
@@ -357,6 +357,13 @@
<guid>/start/fromsource.html</guid>
<description><!---
 Licensed to the Apache Software Foundation
(ASF) under one or more
 contributor license agreements. See the NOTICE
file distributed with
 this work for additional information regarding
copyright ownership.
 The ASF licenses this file to You under the Apache
License, Version 2.0
 (the "License"); you may not use this file
except in compliance with
 the License. You may obtain a copy of the
License at

 http: [...]
</item>
+ <item>
+ <title>Container Replica Debugger Tool</title>
+ <link>/tools/containerlogparser.html</link>
+ <pubDate>Mon, 19 May 2025 00:00:00 +0000</pubDate>
+ <guid>/tools/containerlogparser.html</guid>
+ <description>The tool processes container log files from Ozone datanodes
to track state transitions. It provides CLI commands for querying containers
based on different attributes.</description>
+ </item>
<item>
<title>Minimum free space configuration for datanode volumes</title>
<link>/design/dn-min-space-configuration.html</link>
diff --git a/docs/edge/sitemap.xml b/docs/edge/sitemap.xml
index 3af54b51..f5795dab 100644
--- a/docs/edge/sitemap.xml
+++ b/docs/edge/sitemap.xml
@@ -4,7 +4,7 @@
<sitemap>
<loc>/en/sitemap.xml</loc>
- <lastmod>2025-05-28T10:07:28+05:30</lastmod>
+ <lastmod>2025-06-02T13:47:02+05:30</lastmod>
</sitemap>
diff --git a/docs/edge/tools.html b/docs/edge/tools.html
index 9127b634..8f9db6b1 100644
--- a/docs/edge/tools.html
+++ b/docs/edge/tools.html
@@ -551,6 +551,25 @@ ozone-site.xml.</li>
<div class="row">
+ <div class="col-sm-6">
+ <div class="card">
+ <div class="card-body">
+ <h2 class="card-title">
+
+ Container Replica Debugger Tool
+ </h2>
+ <p class="card-text">The tool processes
container log files from Ozone datanodes to track state transitions. It
provides CLI commands for querying containers based on different attributes.</p>
+ <a href="./tools/containerlogparser.html"
+ class=" btn btn-primary btn-lg">Container
Replica Debugger Tool</a>
+ </div>
+ </div>
+ </div>
+
+
+
+
+
+
<div class="col-sm-6">
<div class="card">
<div class="card-body">
@@ -566,10 +585,14 @@ ozone-site.xml.</li>
</div>
+ </div>
+
+ <div class="row">
+
<div class="col-sm-6">
<div class="card">
<div class="card-body">
@@ -585,14 +608,10 @@ ozone-site.xml.</li>
</div>
- </div>
-
- <div class="row">
-
<div class="col-sm-6">
<div class="card">
<div class="card-body">
@@ -608,10 +627,14 @@ ozone-site.xml.</li>
</div>
+ </div>
+
+ <div class="row">
+
<div class="col-sm-6">
<div class="card">
<div class="card-body">
@@ -627,14 +650,10 @@ ozone-site.xml.</li>
</div>
- </div>
-
- <div class="row">
-
<div class="col-sm-6">
<div class="card">
<div class="card-body">
@@ -650,10 +669,14 @@ ozone-site.xml.</li>
</div>
+ </div>
+
+ <div class="row">
+
<div class="col-sm-6">
<div class="card">
<div class="card-body">
@@ -669,8 +692,6 @@ ozone-site.xml.</li>
</div>
- </div>
-
</div>
diff --git a/docs/edge/tools/containerlogparser.html
b/docs/edge/tools/containerlogparser.html
new file mode 100644
index 00000000..07ca1497
--- /dev/null
+++ b/docs/edge/tools/containerlogparser.html
@@ -0,0 +1,749 @@
+
+
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+
+ <meta name="description" content="Apache Ozone Documentation">
+
+ <title>Documentation for Apache Ozone</title>
+
+
+ <link href="../css/bootstrap.min.css" rel="stylesheet">
+
+
+ <link href="../css/ozonedoc.css" rel="stylesheet">
+
+
+
+ <link href="../swagger-resources/swagger-ui.css" rel="stylesheet">
+
+
+ <script>
+ var _paq = window._paq = window._paq || [];
+
+
+
+ _paq.push(['disableCookies']);
+
+
+ _paq.push(['trackPageView']);
+ _paq.push(['enableLinkTracking']);
+ (function() {
+ var u="//analytics.apache.org/";
+ _paq.push(['setTrackerUrl', u+'matomo.php']);
+ _paq.push(['setSiteId', '34']);
+ var d=document, g=d.createElement('script'),
+s=d.getElementsByTagName('script')[0];
+ g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
+ })();
+ </script>
+
+
+ </head>
+
+
+<body>
+
+
+<nav class="navbar navbar-inverse navbar-fixed-top">
+ <div class="container-fluid">
+ <div class="navbar-header">
+ <button type="button" class="navbar-toggle collapsed"
data-toggle="collapse" data-target="#sidebar" aria-expanded="false"
aria-controls="navbar">
+ <span class="sr-only">Toggle navigation</span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </button>
+ <a href="../index.html" class="navbar-left ozone-logo">
+ <img src="../ozone-logo-small.png"/>
+ </a>
+ <a class="navbar-brand hidden-xs" href="../index.html">
+ Apache Ozone/HDDS Documentation
+ </a>
+ <a class="navbar-brand visible-xs-inline" href="#">Apache Ozone</a>
+ </div>
+ <div id="navbar" class="navbar-collapse collapse">
+ <ul class="nav navbar-nav navbar-right">
+ <li><a href="https://github.com/apache/ozone">Source</a></li>
+ <li><a href="https://ozone.apache.org">Apache Ozone</a></li>
+ <li><a href="https://apache.org">ASF</a></li>
+ </ul>
+ </div>
+ </div>
+</nav>
+
+
+ <div class="wrapper">
+ <div class="container-fluid">
+ <div class="row">
+
+<div class="col-sm-2 col-md-2 sidebar" id="sidebar">
+ <ul class="nav nav-sidebar">
+
+
+
+ <li class="">
+
+ <a href="../index.html">
+
+
+
+ <span>Overview</span>
+ </a>
+ </li>
+
+
+
+ <li class="">
+
+ <a href="../start.html">
+
+
+
+ <span>Getting Started</span>
+ </a>
+ </li>
+
+
+
+ <li class="">
+ <a href="../concept.html">
+
+ <span>Architecture</span>
+ </a>
+ <ul class="nav">
+
+ <li class="">
+
+ <a href="../concept/overview.html">Overview</a>
+
+ </li>
+
+ <li class="">
+
+ <a href="../concept/ozonemanager.html">Ozone
Manager</a>
+
+ </li>
+
+ <li class="">
+
+ <a
href="../concept/storagecontainermanager.html">Storage Container Manager</a>
+
+ </li>
+
+ <li class="">
+
+ <a href="../concept/containers.html">Containers</a>
+
+ </li>
+
+ <li class="">
+
+ <a href="../concept/datanodes.html">Datanodes</a>
+
+ </li>
+
+ <li class="">
+
+ <a href="../concept/recon.html">Recon</a>
+
+ </li>
+
+ <li class="">
+
+ <a href="../concept/networkports.html">Network
Ports</a>
+
+ </li>
+
+ </ul>
+ </li>
+
+
+
+ <li class="">
+ <a href="../feature.html">
+
+ <span>Features</span>
+ </a>
+ <ul class="nav">
+
+ <li class="">
+
+ <a
href="../feature/decommission.html">Decommissioning</a>
+
+ </li>
+
+ <li class="">
+
+ <a href="../feature/om-ha.html">OM High
Availability</a>
+
+ </li>
+
+ <li class="">
+
+ <a href="../feature/erasurecoding.html">Ozone
Erasure Coding</a>
+
+ </li>
+
+ <li class="">
+
+ <a href="../feature/snapshot.html">Ozone
Snapshot</a>
+
+ </li>
+
+ <li class="">
+
+ <a href="../feature/scm-ha.html">SCM High
Availability</a>
+
+ </li>
+
+ <li class="">
+
+ <a
href="../feature/streaming-write-pipeline.html">Streaming Write Pipeline</a>
+
+ </li>
+
+ <li class="">
+
+ <a href="../feature/dn-merge-rocksdb.html">Merge
Container RocksDB in DN</a>
+
+ </li>
+
+ <li class="">
+
+ <a href="../feature/prefixfso.html">Prefix based
File System Optimization</a>
+
+ </li>
+
+ <li class="">
+
+ <a href="../feature/topology.html">Topology
awareness</a>
+
+ </li>
+
+ <li class="">
+
+ <a href="../feature/quota.html">Quota in Ozone</a>
+
+ </li>
+
+ <li class="">
+
+ <a href="../feature/recon.html">Recon Server</a>
+
+ </li>
+
+ <li class="">
+
+ <a
href="../feature/observability.html">Observability</a>
+
+ </li>
+
+ <li class="">
+
+ <a
href="../feature/nonrolling-upgrade.html">Non-Rolling Upgrades and
Downgrades</a>
+
+ </li>
+
+ <li class="">
+
+ <a href="../feature/s3-multi-tenancy.html">
+
+ <span>S3 Multi-Tenancy</span>
+ </a>
+ <ul class="nav">
+
+ <li class="">
+ <a
href="../feature/s3-multi-tenancy-setup.html">Setup</a>
+ </li>
+
+ <li class="">
+ <a
href="../feature/s3-tenant-commands.html">Tenant commands</a>
+ </li>
+
+ <li class="">
+ <a
href="../feature/s3-multi-tenancy-access-control.html">Access Control</a>
+ </li>
+
+ </ul>
+
+ </li>
+
+ <li class="">
+
+ <a
href="../feature/reconfigurability.html">Reconfigurability</a>
+
+ </li>
+
+ </ul>
+ </li>
+
+
+
+ <li class="">
+ <a href="../integration.html">
+
+ <span>Application Integrations</span>
+ </a>
+ <ul class="nav">
+
+ <li class="">
+
+ <a href="../integration/distcp.html">Hadoop
DistCp</a>
+
+ </li>
+
+ <li class="">
+
+ <a href="../integration/hive.html">Hive</a>
+
+ </li>
+
+ <li class="">
+
+ <a href="../integration/impala.html">Impala</a>
+
+ </li>
+
+ </ul>
+ </li>
+
+
+
+ <li class="">
+ <a href="../interface.html">
+
+ <span>Client Interfaces</span>
+ </a>
+ <ul class="nav">
+
+ <li class="">
+
+ <a href="../interface/ofs.html">Ofs (Hadoop
compatible)</a>
+
+ </li>
+
+ <li class="">
+
+ <a href="../interface/o3fs.html">O3fs (Hadoop
compatible)</a>
+
+ </li>
+
+ <li class="">
+
+ <a href="../interface/s3.html">S3 Protocol</a>
+
+ </li>
+
+ <li class="">
+
+ <a href="../interface/cli.html">Command Line
Interface</a>
+
+ </li>
+
+ <li class="">
+
+ <a href="../interface/reconapi.html">Recon API</a>
+
+ </li>
+
+ <li class="">
+
+ <a href="../interface/javaapi.html">Java API</a>
+
+ </li>
+
+ <li class="">
+
+ <a href="../interface/csi.html">CSI Protocol</a>
+
+ </li>
+
+ <li class="">
+
+ <a href="../interface/httpfs.html">HttpFS
Gateway</a>
+
+ </li>
+
+ </ul>
+ </li>
+
+
+
+ <li class="">
+ <a href="../security.html">
+
+ <span>Security</span>
+ </a>
+ <ul class="nav">
+
+ <li class="">
+
+ <a href="../security/secureozone.html">Securing
Ozone</a>
+
+ </li>
+
+ <li class="">
+
+ <a href="../security/securingtde.html">Transparent
Data Encryption</a>
+
+ </li>
+
+ <li class="">
+
+ <a href="../security/gdpr.html">GDPR in Ozone</a>
+
+ </li>
+
+ <li class="">
+
+ <a
href="../security/securingdatanodes.html">Securing Datanodes</a>
+
+ </li>
+
+ <li class="">
+
+ <a
href="../security/securingozonehttp.html">Securing HTTP</a>
+
+ </li>
+
+ <li class="">
+
+ <a href="../security/securings3.html">Securing
S3</a>
+
+ </li>
+
+ <li class="">
+
+ <a href="../security/securityacls.html">Ozone
ACLs</a>
+
+ </li>
+
+ <li class="">
+
+ <a
href="../security/securitywithranger.html">Apache Ranger</a>
+
+ </li>
+
+ </ul>
+ </li>
+
+
+
+ <li class="">
+
+ <a href="../tools.html">
+
+
+
+ <span>Tools</span>
+ </a>
+ </li>
+
+
+
+ <li class="">
+
+ <a href="../recipe.html">
+
+
+
+ <span>Recipes</span>
+ </a>
+ </li>
+
+
+ <li><a href="../design.html"><span><b>Design docs</b></span></a></li>
+ <li class="visible-xs"><a href="#">References</a>
+ <ul class="nav">
+ <li><a href="https://github.com/apache/ozone"><span class="glyphicon
glyphicon-new-window" aria-hidden="true"></span> Source</a></li>
+ <li><a href="https://ozone.apache.org"><span class="glyphicon
glyphicon-new-window" aria-hidden="true"></span> Apache Ozone</a></li>
+ <li><a href="https://apache.org"><span class="glyphicon
glyphicon-new-window" aria-hidden="true"></span> ASF</a></li>
+ </ul></li>
+ </ul>
+
+</div>
+
+ <div class="col-sm-10 col-sm-offset-2 col-md-10 col-md-offset-2
main-content">
+
+
+
+ <div class="col-md-9">
+ <nav aria-label="breadcrumb">
+ <ol class="breadcrumb">
+ <li class="breadcrumb-item"><a
href="../index.html">Home</a></li>
+ <li class="breadcrumb-item" aria-current="page"><a
href="../tools.html">Tools</a></li>
+ <li class="breadcrumb-item active"
aria-current="page">Container Replica Debugger Tool</li>
+ </ol>
+ </nav>
+
+
+
+<div class="pull-right">
+
+
+
+</div>
+
+
+ <div class="col-md-9">
+ <h1>Container Replica Debugger Tool</h1>
+
+ <!--
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. See accompanying LICENSE file.
+-->
+<h1 id="container-replica-debugger-tool">Container Replica Debugger Tool</h1>
+<h2 id="background">Background</h2>
+<p>Containers are the most important part of ozone. Most of the ozone
operations happen on them. Containers in ozone go through different states in
their lifecycle.
+In the past we have seen different issues on container state. To debug
problems we always use manual steps and identify problems w.r.t containers and
this takes a lot of time. To optimize debugability we can show historical
timeline and other information w.r.t containers.</p>
+<h2 id="solution-approach">Solution Approach</h2>
+<p>An offline tool that would analyse the dn-container log files and help us
find issues related to the containers across the datanodes in the cluster.</p>
+<h3 id="component-1-parser">Component 1: Parser</h3>
+<p>This component is responsible for processing log files, extracting relevant
log entries, and storing them in batches to be inserted into the database.</p>
+<p><strong>The command is as follows:</strong></p>
+<p><code>ozone debug log container --db=<path to db> parse
--path=<path to logs folder> --thread-count=<n></code></p>
+<h4 id="concurrent-log-file-processing">Concurrent Log File Processing</h4>
+<ul>
+<li><strong>Directory Traversal</strong>: It recursively scans a specified
directory for container log files using <code>Files.walk()</code>.</li>
+<li><strong>File Filtering</strong>: Only files with names matching the
pattern <code>dn-container-<roll>.log.<datanodeId></code> are
considered. Files that do not satisfy this pattern are skipped.</li>
+<li><strong>Thread Pool Execution</strong>: A fixed-size thread pool is
created using <code>ExecutorService</code>, where each thread is responsible
for processing a single log file independently. This ensures no file-level
concurrency issues.</li>
+<li><strong>Synchronization with <code>CountDownLatch</code></strong>: A
<code>CountDownLatch</code> is used to block the main thread until all worker
threads have finished processing their respective files.</li>
+<li><strong>Error Detection</strong>: An <code>AtomicBoolean</code> is used to
record if any thread encounters a <code>SQLException</code>. If set, the entire
operation is considered failed.</li>
+</ul>
+<h4 id="log-file-parsing-and-validation">Log File Parsing and Validation</h4>
+<ul>
+<li><strong>Line-by-Line Processing</strong>: Each log line is split using a
pipe delimiter and parsed into key-value components.</li>
+<li><strong>Field Extraction</strong>: Key fields include:
+<ul>
+<li><strong>Timestamp</strong></li>
+<li><strong>logLevel</strong>: INFO, WARN, ERROR.</li>
+<li><strong>ID, BCSID, State, and Index</strong>: Extracted from key-value
pairs.</li>
+</ul>
+</li>
+<li><strong>Error Message Capture</strong>: Any remaining unstructured part of
the log line is stored as <code>errorMessage</code>, especially relevant for
WARN or ERROR level logs.</li>
+<li><strong>Replication Index Filtering</strong>: Only log entries with Index
= 0 are processed. This limits current processing to Ratis-replicated
containers. Future improvements may support EC replication.</li>
+</ul>
+<h4 id="log-entry-object-construction">Log Entry Object Construction</h4>
+<p>A builder pattern is used to create objects from parsed data. These objects
represent a single log entry with structured fields.</p>
+<h4 id="batching-and-database-insertion">Batching and Database Insertion</h4>
+<ul>
+<li>Parsed entries are accumulated in a local batch list of size
<code>MAX_OBJ_IN_LIST</code> (default: 5000).</li>
+<li>When the list reaches the threshold, it is flushed to the database.</li>
+<li>At the end of file processing, any remaining entries in the batch are also
written to the database.</li>
+</ul>
+<h4 id="thread-safety-and-simplification">Thread Safety and Simplification</h4>
+<p>Each thread maintains its own batch list. There are no shared data
structures between threads. The simplified concurrency model improves code
maintainability and reduces potential for deadlocks or race conditions.</p>
+<h3 id="component-2-database">Component 2: Database</h3>
+<p>The tool uses a temporary SQLite database to store and manage information
extracted from container logs. This helps organize the data so that both the
complete history and the latest status of each container replica on a datanode
can be analyzed easily.</p>
+<h4 id="there-are-2-major-tables-createdmaintained-by-the-tool">There are 2
major tables created/maintained by the tool:</h4>
+<ol>
+<li>
+<p><strong>DatanodeContainerLogTable — Detailed Log History</strong><br>
+This table stores a complete history of state changes for each container
replica on every datanode.</p>
+<ul>
+<li>Container ID</li>
+<li>Datanode ID</li>
+<li>State (such as OPEN, CLOSED, etc.)</li>
+<li>BCSID (Block Commit Sequence ID)</li>
+<li>Timestamp</li>
+<li>Log Level</li>
+<li>Error Message (if any)</li>
+<li>Index Value</li>
+</ul>
+<p>The data in this table shows a complete timeline of state transitions and
BCSID changes, helping to trace how each container replica evolved over
time.</p>
+</li>
+<li>
+<p><strong>ContainerLogTable — Latest Status Summary</strong><br>
+This table contains only the most recent state and BCSID for each unique
container and datanode pair.</p>
+<ul>
+<li>Container ID</li>
+<li>Datanode ID</li>
+<li>Latest State</li>
+<li>Latest BCSID</li>
+</ul>
+<p>This table provides a simplified view of the current state and BCSID of all
container replicas, which helps with quick status checks and summaries.</p>
+</li>
+</ol>
+<h3 id="component-3-cli-commands"><strong>Component 3: CLI
Commands</strong></h3>
+<h4 id="to-list-containers-having-duplicate-open-states"><strong>To List
Containers Having Duplicate Open States</strong></h4>
+<p>This Ozone debug CLI command helps to identify containers that were opened
more than the required number (for Ratis, it is 3) by tracking the first three
“OPEN” states and flagging any subsequent “OPEN” state
as problematic if it occurs on the same datanode or on a different datanode
after the initial events.</p>
+<p>This command displays the <strong>Container ID</strong> along with the
count of replicas in the ‘OPEN’ state for each listed container. It
also provides the total number of containers that have duplicate
‘OPEN’ state entries.</p>
+<p><strong>The command is as follows:</strong></p>
+<p><code>ozone debug log container --db=<path to db>
duplicate-open</code></p>
+<p><strong>Sample output:</strong></p>
+<pre tabindex="0"><code>Container ID: 2187256 - OPEN state count: 4
+.
+.
+.
+Container ID: 12377064 - OPEN state count: 5
+Container ID: 12377223 - OPEN state count: 5
+Container ID: 12377631 - OPEN state count: 4
+Container ID: 12377904 - OPEN state count: 5
+Container ID: 12378161 - OPEN state count: 4
+Container ID: 12378352 - OPEN state count: 5
+Container ID: 12378789 - OPEN state count: 5
+Container ID: 12379337 - OPEN state count: 5
+Container ID: 12379489 - OPEN state count: 5
+Container ID: 12380526 - OPEN state count: 5
+Container ID: 12380898 - OPEN state count: 5
+Container ID: 12642718 - OPEN state count: 4
+Container ID: 12644806 - OPEN state count: 4
+Total containers that might have duplicate OPEN state : 1579
+</code></pre><br>
+<h4
id="to-display-details-of-a-single-container-along-with-analysis"><strong>To
Display Details of a Single Container Along with Analysis</strong></h4>
+<p>This ozone debug CLI command provides a complete state transition history
for each replica of the container whose ID is provided via the command.<br>
+The command also provides analysis over the container such as if the container
has issues like:</p>
+<ul>
+<li>Duplicate OPEN states</li>
+<li>Mismatched replication</li>
+<li>Under-replication or over-replication</li>
+<li>Unhealthy replicas</li>
+<li>Open-unhealthy</li>
+<li>Quasi-closed stuck containers</li>
+</ul>
+<p>The command provides key details such as:</p>
+<ul>
+<li>Datanode id</li>
+<li>Container id</li>
+<li>BCSID</li>
+<li>TimeStamp</li>
+<li>Index Value</li>
+<li>Message (if any associated with that particular replica)</li>
+</ul>
+<p><strong>The command is as follows:</strong></p>
+<p><code>ozone debug log container --db=<path to database> info
<containerID></code></p>
+<p><strong>Sample output:</strong></p>
+<pre tabindex="0"><code>Timestamp | Container ID | Datanode ID |
Container State | BCSID | Message | Index Value
+----------------------------------------------------------------------------------------------------------------------
+2024-06-04 15:07:55,390 | 700 | 100 | QUASI_CLOSED |
353807 | No error | 0
+2024-06-04 14:50:18,177 | 700 | 150 | QUASI_CLOSED |
353807 | No error | 0
+2024-04-04 10:32:29,026 | 700 | 250 | OPEN | 0
| No error | 0
+2024-06-04 14:44:28,126 | 700 | 250 | CLOSING |
353807 | No error | 0
+2024-06-04 14:47:59,893 | 700 | 250 | QUASI_CLOSED |
353807 | Ratis group removed | 0
+2024-06-04 14:50:17,038 | 700 | 250 | QUASI_CLOSED |
353807 | No error | 0
+2024-06-04 14:50:18,184 | 700 | 250 | QUASI_CLOSED |
353807 | No error | 0
+2024-04-04 10:32:29,026 | 700 | 400 | OPEN | 0
| No error | 0
+Container 700 might be QUASI_CLOSED_STUCK.
+</code></pre><br>
+<h4 id="to-list-containers-based-on-health-state"><strong>To List Containers
Based on Health State</strong></h4>
+<p>This ozone debug CLI command lists all the containers which are either
UNDER-REPLICATED, OVER-REPLICATED, UNHEALTHY, or QUASI_CLOSED stuck.</p>
+<p>This command displays the <strong>Container ID</strong> along with the
count of replicas in the specified health state for each listed container.</p>
+<p><strong>The command options used are:</strong></p>
+<ul>
+<li>List containers by health type: this by default provides only 100 rows in
the result</li>
+</ul>
+<p><code>ozone debug log container --db=<path to db> list
--health=<type></code></p>
+<ul>
+<li>List containers by health type with a specified row limit:</li>
+</ul>
+<p><code>ozone debug log container --db=<path to db> list
--health=<type> --length=<limit></code></p>
+<ul>
+<li>List all containers by health type, overriding the row limit:</li>
+</ul>
+<p><code>ozone debug log container --db=<path to db> list
--health=<type> --all</code></p>
+<p><strong>Sample output:</strong></p>
+<pre tabindex="0"><code>Container ID = 6002 - Count = 1
+Container ID = 6201 - Count = 1
+.
+.
+.
+Container ID = 136662 - Count = 3
+Container ID = 136837 - Count = 3
+Container ID = 199954 - Count = 3
+Container ID = 237747 - Count = 3
+Container ID = 2579099 - Count = 1
+Container ID = 2626888 - Count = 1
+Container ID = 2627711 - Count = 1
+Container ID = 2627751 - Count = 2
+Number of containers listed: 25085
+</code></pre><br>
+<h4 id="to-list-containers-based-on-final-state"><strong>To List Containers
Based on Final State</strong></h4>
+<p>This ozone debug CLI command helps to list replicas of all the containers
which have the state provided via the CLI command as their latest state.</p>
+<p>The command provides key details such as:</p>
+<ul>
+<li>Datanode id</li>
+<li>Container id</li>
+<li>BCSID</li>
+<li>TimeStamp - The most recent timestamp associated with the container
replica state</li>
+<li>Index Value</li>
+<li>Message (if any associated with that particular replica)</li>
+</ul>
+<p><strong>The command options used are:</strong></p>
+<ul>
+<li>List containers by state: this by default provides only 100 rows in the
result</li>
+</ul>
+<p><code>ozone debug log container --db=<path to db> list
--lifecycle=<state></code></p>
+<ul>
+<li>List containers by state with a specified row limit:</li>
+</ul>
+<p><code>ozone debug log container --db=<path to db> list
--lifecycle=<state> --length=<limit></code></p>
+<ul>
+<li>List all containers by state, overriding the row limit:</li>
+</ul>
+<p><code>ozone debug log container --db=<path to db> list
--lifecycle=<state> --all</code></p>
+<p><strong>Sample output:</strong></p>
+<pre tabindex="0"><code>Timestamp | Datanode ID | Container ID
| BCSID | Message | Index Value
+---------------------------------------------------------------------------------------------------
+2024-07-23 12:02:12,981 | 360 | 1 | 75654 | No error
| 0
+2024-07-23 11:56:21,106 | 365 | 1 | 75654 | Volume
failure | 0
+2024-07-23 11:56:21,106 | 365 | 1 | 75654 | Volume
failure | 0
+2024-08-29 14:11:32,879 | 415 | 1 | 30 | No error
| 0
+2024-08-29 14:11:17,533 | 430 | 1 | 30 | No error
| 0
+2024-06-20 11:50:09,496 | 460 | 1 | 75654 | No error
| 0
+2024-07-23 12:02:11,633 | 500 | 1 | 75654 | No error
| 0
+2024-06-20 12:03:24,230 | 505 | 2 | 83751 | No error
| 0
+2024-07-10 04:00:33,131 | 540 | 2 | 83751 | No error
| 0
+2024-07-10 04:00:46,825 | 595 | 2 | 83751 | No error
| 0
+</code></pre><br>
+<h3 id="note">NOTE</h3>
+<ul>
+<li>This tool assumes that all dn-container log files are already extracted
from the datanodes and placed into a directory.</li>
+<li>For the parsing command, if the DB path is not provided, a new database
will be created in the current working directory with the default filename
<code>container_datanode.db</code>.</li>
+<li>For all other commands, if the DB path is not provided, it will look for a
default database (<code>container_datanode.db</code>) file in the current
directory. If it doesn’t exist, it will throw an error asking to provide a
valid path.</li>
+</ul>
+
+
+
+ <a class="btn btn-success btn-lg" href="../tools/debug.html">Next
>></a>
+
+ </div>
+
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="push"></div>
+ </div>
+
+
+
+<footer class="footer">
+ <div class="container">
+ <span class="small text-muted">
+ Version: 2.1.0-SNAPSHOT, Last Modified: June 2, 2025 <a
class="hide-child link primary-color"
href="https://github.com/apache/ozone/commit/8e8c432bb7e893d140926fb7df4f316ac9265cbe">8e8c432bb7</a>
+ </span>
+ </div>
+</footer>
+
+
+
+<script src="../js/jquery-3.5.1.min.js"></script>
+<script src="../js/ozonedoc.js"></script>
+<script src="../js/bootstrap.min.js"></script>
+
+
+</body>
+
+</html>
\ No newline at end of file
diff --git a/docs/edge/tools/index.xml b/docs/edge/tools/index.xml
index 56ace173..aaa367cd 100644
--- a/docs/edge/tools/index.xml
+++ b/docs/edge/tools/index.xml
@@ -6,8 +6,15 @@
<description>Recent content in Tools on Ozone</description>
<generator>Hugo</generator>
<language>en</language>
- <lastBuildDate>Thu, 13 Mar 2025 10:19:47 +0530</lastBuildDate>
+ <lastBuildDate>Mon, 02 Jun 2025 13:47:02 +0530</lastBuildDate>
<atom:link href="/tools/index.xml" rel="self" type="application/rss+xml" />
+ <item>
+ <title>Container Replica Debugger Tool</title>
+ <link>/tools/containerlogparser.html</link>
+ <pubDate>Mon, 19 May 2025 00:00:00 +0000</pubDate>
+ <guid>/tools/containerlogparser.html</guid>
+ <description>The tool processes container log files from Ozone datanodes
to track state transitions. It provides CLI commands for querying containers
based on different attributes.</description>
+ </item>
<item>
<title>Ozone Debug</title>
<link>/tools/debug.html</link>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]