swamirishi commented on code in PR #7402:
URL: https://github.com/apache/ozone/pull/7402#discussion_r1838587332
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/impl/ContainerSet.java:
##########
@@ -85,22 +98,41 @@ public void setRecoveringTimeout(long recoveringTimeout) {
this.recoveringTimeout = recoveringTimeout;
}
+ public boolean addContainer(Container<?> container) throws
StorageContainerException {
+ return addContainer(container, false);
+ }
+
/**
* Add Container to container map.
* @param container container to be added
* @return If container is added to containerMap returns true, otherwise
* false
*/
- public boolean addContainer(Container<?> container) throws
+ public boolean addContainer(Container<?> container, boolean
overwriteMissingContainers) throws
StorageContainerException {
Preconditions.checkNotNull(container, "container cannot be null");
long containerId = container.getContainerData().getContainerID();
+ State containerState = container.getContainerData().getState();
+ if (!overwriteMissingContainers &&
missingContainerSet.contains(containerId)) {
Review Comment:
The container set is first initialised with all the containers present on
disk by performing an ls on the data volumes. Then we iterate through the
containerIDs table on the rocksdb, and any container present in this table and
not present on disk will be added to the missing container set. This would
include both ratis and ec containers.
Now on container creation we just have to check this in memory set than
going to the rocksdb everytime which would incur an io cost, however small it
is not need in my opinion when we have everything in memory.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]