[
https://issues.apache.org/jira/browse/HDDS-1263?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16794865#comment-16794865
]
Nanda kumar commented on HDDS-1263:
-----------------------------------
According to {{listContainer}} documentation
{noformat}
/**
* Returns containers under certain conditions.
* Search container IDs from start ID(exclusive),
* The max size of the searching range cannot exceed the
* value of count.
*
* @param startContainerID start containerID, >=0,
* start searching at the head if 0.
* @param count count must be >= 0
* Usually the count will be replace with a very big
* value instead of being unlimited in case the db is very big.
*
* @return a list of container.
* @throws IOException
{noformat}
Start ID should be excluded from the result, this patch breaks that behavior.
A better way to fix this is to change {{SCMClientProtocolServer}} to handle '0'
{code:java}
public List<ContainerInfo> listContainer(long startContainerID, int count)
throws IOException {
......
final ContainerID containerId = startContainerID != 0 ?
ContainerID.valueof(startContainerID) : null;
return scm.getContainerManager().listContainer(containerId, count);
......
}
{code}
> SCM CLI does not list container with id 1
> -----------------------------------------
>
> Key: HDDS-1263
> URL: https://issues.apache.org/jira/browse/HDDS-1263
> Project: Hadoop Distributed Data Store
> Issue Type: Bug
> Components: Ozone CLI
> Affects Versions: 0.4.0
> Reporter: Vivek Ratnavel Subramanian
> Assignee: Vivek Ratnavel Subramanian
> Priority: Major
> Labels: pull-request-available
> Fix For: 0.4.0, 0.5.0
>
> Time Spent: 50m
> Remaining Estimate: 0h
>
> Steps to reproduce
> # Create two containers
> {code:java}
> ozone scmcli create
> ozone scmcli create{code}
> # Try to list containers
> {code:java}
> hadoop@7a73695402ae:~$ ozone scmcli list --start=0
> Container ID should be a positive long. 0
> hadoop@7a73695402ae:~$ ozone scmcli list --start=1
> {
> "state" : "OPEN",
> "replicationFactor" : "ONE",
> "replicationType" : "STAND_ALONE",
> "usedBytes" : 0,
> "numberOfKeys" : 0,
> "lastUsed" : 274660388,
> "stateEnterTime" : 274646481,
> "owner" : "OZONE",
> "containerID" : 2,
> "deleteTransactionId" : 0,
> "sequenceId" : 0,
> "open" : true
> }{code}
> There is no way to list the container with containerID 1.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]