[ https://issues.apache.org/jira/browse/HDDS-13595?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ivan Andika updated HDDS-13595: ------------------------------- Summary: ListKeys should not overwrite entry if non-null cache entry exists (was: ListKeys should not overwrite entry if cache exists) > ListKeys should not overwrite entry if non-null cache entry exists > ------------------------------------------------------------------ > > Key: HDDS-13595 > URL: https://issues.apache.org/jira/browse/HDDS-13595 > Project: Apache Ozone > Issue Type: Bug > Reporter: Ivan Andika > Assignee: Ivan Andika > Priority: Major > > In the listKeys, the following code is used to not list the keys if the cache > entry marks it as deleted. > > {code:java} > // Entry should not be marked for delete, consider only those > // entries. > CacheValue<OmKeyInfo> cacheValue = > keyTable.getCacheValue(new CacheKey<>(kv.getKey())); > if (cacheValue == null || cacheValue.getCacheValue() != null) { > cacheKeyMap.put(kv.getKey(), kv.getValue()); > currentCount++; > } {code} > > However, it overwrites the cache key map (i.e. Map#put) regardless whether > cacheKeyMap contains the entry or not. This might not be correct in key > overwrite case where both cache and DB contains non-null entry, but cache > entry should be more up-to-date and should be returned instead. -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@ozone.apache.org For additional commands, e-mail: issues-h...@ozone.apache.org