[ 
https://issues.apache.org/jira/browse/HDDS-14800?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18064981#comment-18064981
 ] 

Priyesh K edited comment on HDDS-14800 at 3/11/26 8:43 AM:
-----------------------------------------------------------

Thanks for the feedback everyone. [~weichiu] [~erose] [~ayarovoy] 

The [fix|https://github.com/apache/ozone/pull/9904/changes] addresses all the 
concerns raised here by working at two levels

1. Fast-fail check ({{{}isClosed(){}}}) {{RDBStoreAbstractIterator.hasNext()}} 
now checks if the RocksDB is closed before calling any iterator methods. This 
ensures the scanner stops immediately after {{failVolume()}} is triggered, 
without attempting further DB operations.

2. Reference counting via {{acquire()/release}} {{RDBStoreAbstractIterator}} 
now calls {{RocksDatabase.acquire()}} when an iterator is created and releases 
it when the iterator is closed. {{RocksDatabase.waitAndClose()}} already spins 
until the counter reaches zero before physically closing the DB. 

So fixing {{RDBStoreAbstractIterator}} covers both scanners without touching 
either scanner class.

cc : [~Sammi] 


was (Author: JIRAUSER308991):
Thanks for the feedback everyone. [~weichiu] [~erose] [~ayarovoy] 

The 
[fix|https://github.com/priyeshkaratha/ozone/commit/d8edbcb464b65f693f80928169cbba5f2c3afd5c#diff-64055e087acc645f03dab3958822ba6177b29d1be548a4d1e21e50260e463a3b]
 addresses all the concerns raised here by working at two levels

1. Fast-fail check ({{{}isClosed(){}}}) {{RDBStoreAbstractIterator.hasNext()}} 
now checks if the RocksDB is closed before calling any iterator methods. This 
ensures the scanner stops immediately after {{failVolume()}} is triggered, 
without attempting further DB operations.

2. Reference counting via {{acquire()/release}} {{RDBStoreAbstractIterator}} 
now calls {{RocksDatabase.acquire()}} when an iterator is created and releases 
it when the iterator is closed. {{RocksDatabase.waitAndClose()}} already spins 
until the counter reaches zero before physically closing the DB. 

So fixing {{RDBStoreAbstractIterator}} covers both scanners without touching 
either scanner class.

cc : [~Sammi] 

> Check DB open state during one container scanning in 
> BackgroundContainerDataScanner 
> ------------------------------------------------------------------------------------
>
>                 Key: HDDS-14800
>                 URL: https://issues.apache.org/jira/browse/HDDS-14800
>             Project: Apache Ozone
>          Issue Type: Sub-task
>            Reporter: Sammi Chen
>            Assignee: Priyesh K
>            Priority: Major
>              Labels: pull-request-available
>
> StorageVolumeChecker and BackgroundContainerDataScanner are running in 
> parallel. 
> When StorageVolumeChecker detects a volume check fails twice(configurable), 
> it will fail the volume, close the rocksdb for this volume. 
> Since BackgroundContainerDataScanner doesn't get notified for DB close, so it 
> should check the DB open/close state during a container's scan, before 
> calling rocksdb APIs. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to