-
Notifications
You must be signed in to change notification settings - Fork 588
HDDS-9041. Intermittent Delete root failed. #5204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
42847f6
d681d6d
cffc869
b97ffa3
da7ed46
bccbebd
16828b0
452d1c8
06884b0
6af6988
47b2708
fbe53ce
0bf588c
8a7d35b
4718abf
f655c9e
160edf4
07c48da
e722c01
2a7f04c
af06a7f
cbe02e8
60a4eab
0994c55
c455972
1ce9c3e
4ffb500
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,6 +51,7 @@ | |
| import java.util.NoSuchElementException; | ||
| import java.util.Collection; | ||
| import java.util.Collections; | ||
| import java.util.stream.Collectors; | ||
|
|
||
|
|
||
| import static org.apache.hadoop.ozone.om.exceptions.OMException. | ||
|
|
@@ -214,11 +215,12 @@ public Collection<OzoneFileStatus> listStatusFSO(OmKeyArgs args, | |
| HeapEntry entry = heapIterator.next(); | ||
| OzoneFileStatus status = entry.getStatus(prefixKey, | ||
| scmBlockSize, volumeName, bucketName, replication); | ||
| map.put(entry.key, status); | ||
| map.putIfAbsent(entry.key, status); | ||
| } | ||
| } | ||
|
|
||
| return map.values(); | ||
| return map.values().stream().filter(e -> e != null).collect( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will the status ever be null? If it can be, will putting the null check before putting it in the map a better idea?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @duongkame thanks for review. Earlier the null value (means key deleted) from CacheIter was not added in map and was getting lost, so we should allow that and when keyInfo gets null and then getStatus , we'll return null. This was needed to allow deleted key in cache. |
||
| Collectors.toList()); | ||
| } | ||
|
|
||
| private String getDbKey(String key, OmKeyArgs args, | ||
|
|
@@ -285,7 +287,7 @@ private static class HeapEntry implements Comparable<HeapEntry> { | |
| private final Object value; | ||
|
|
||
| HeapEntry(EntryType entryType, String key, Object value) { | ||
| Preconditions.checkArgument( | ||
| Preconditions.checkArgument(value == null || | ||
| value instanceof OmDirectoryInfo || | ||
| value instanceof OmKeyInfo); | ||
| this.entryType = entryType; | ||
|
|
@@ -322,6 +324,9 @@ public OzoneFileStatus getStatus( | |
| String bucketName, | ||
| ReplicationConfig bucketReplication | ||
| ) { | ||
| if (value == null) { | ||
| return null; | ||
| } | ||
| OmKeyInfo keyInfo; | ||
| if (entryType.isDir()) { | ||
| Preconditions.checkArgument(value instanceof OmDirectoryInfo); | ||
|
|
@@ -455,10 +460,6 @@ private void getCacheValues() { | |
| cacheIter.next(); | ||
| String cacheKey = entry.getKey().getCacheKey(); | ||
| Value cacheOmInfo = entry.getValue().getCacheValue(); | ||
| // cacheOmKeyInfo is null if an entry is deleted in cache | ||
| if (cacheOmInfo == null) { | ||
| continue; | ||
| } | ||
|
|
||
| // Copy cache value to local copy and work on it | ||
| if (cacheOmInfo instanceof CopyObject) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, this is done with the assumption that the items from the cache iterator always come before those from the rockdb iterator?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes @duongkame as per MinHeapIterator implementation.