Merged
Conversation
132f78e to
f0c97a5
Compare
JackieTien97
requested changes
Apr 8, 2024
Comment on lines
+301
to
+305
| if (cacheEntry.getLastCacheContainer().getCachedLast() != null) { | ||
| cacheStats.decreaseMemoryUsage( | ||
| cacheEntry.getLastCacheContainer().getCachedLast().getSize()); | ||
| } | ||
| DataNodeLastCacheManager.invalidateLastCache(cacheEntry); |
Contributor
There was a problem hiding this comment.
why don't usesynchronized (entry) here?
| @Override | ||
| public int updateValue(int index, SchemaCacheEntry value) { | ||
| DataNodeLastCacheManager.invalidateLastCache(value); | ||
| return 0; |
Contributor
There was a problem hiding this comment.
it should return the diff memory size instead of 0.
...pache/iotdb/db/queryengine/plan/analyze/cache/schema/dualkeycache/impl/DualKeyCacheImpl.java
Outdated
Show resolved
Hide resolved
...pache/iotdb/db/queryengine/plan/analyze/cache/schema/dualkeycache/impl/DualKeyCacheImpl.java
Outdated
Show resolved
Hide resolved
...pache/iotdb/db/queryengine/plan/analyze/cache/schema/dualkeycache/impl/DualKeyCacheImpl.java
Outdated
Show resolved
Hide resolved
...pache/iotdb/db/queryengine/plan/analyze/cache/schema/dualkeycache/impl/DualKeyCacheImpl.java
Outdated
Show resolved
Hide resolved
...org/apache/iotdb/db/queryengine/plan/analyze/cache/schema/lastcache/ILastCacheContainer.java
Outdated
Show resolved
Hide resolved
...pache/iotdb/db/queryengine/plan/analyze/cache/schema/lastcache/DataNodeLastCacheManager.java
Outdated
Show resolved
Hide resolved
...pache/iotdb/db/queryengine/plan/analyze/cache/schema/dualkeycache/impl/DualKeyCacheImpl.java
Outdated
Show resolved
Hide resolved
| private final long deleteStartTime; | ||
| private final long deleteEndTime; | ||
|
|
||
| private final boolean isDeleteTimeseries; |
Contributor
There was a problem hiding this comment.
add some comments here to explain why this field doesn't need to be serialized (because it will always be false except for that in delete timesereis, and in which case we will set this to true in DataNodeInternalRPCServiceImpl.deleteDataForDeleteSchema.
Suggested change
| private final boolean isDeleteTimeseries; | |
| private final transient boolean isDeleteTimeseries; |
JackieTien97
requested changes
Apr 8, 2024
| } | ||
|
|
||
| private void resetLastCacheWhenLoadingTsFile() throws IllegalPathException { | ||
| private void resetLastCacheWhenLoadingTsFile() { |
Contributor
There was a problem hiding this comment.
just call DataNodeSchemaCache.getInstance().unsetLastCacheInDataRegion(getDatabaseName())?
a6f252a to
13e658b
Compare
JackieTien97
requested changes
Apr 9, 2024
| measurementFilter = m -> true; | ||
| } | ||
| if (deviceFilter == null) { | ||
| deviceFilter = d -> ((PartialPath) d).equals(devicePath.getFullPath()); |
Contributor
There was a problem hiding this comment.
Suggested change
| deviceFilter = d -> ((PartialPath) d).equals(devicePath.getFullPath()); | |
| deviceFilter = d -> ((PartialPath) d).equals(devicePath); |
5fce2fc to
afae3fe
Compare
JackieTien97
approved these changes
Apr 9, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The current system has a deadlock problem when the deletion is concurrent with query and insertion:
DeadLock cycle like this:
In this pr:
0001-to-cause-dead-lock-when-delete.patch
In this patch, datanodeCache will always be empty, so query or insert will fetch remote schema. Besides the query worker's num is limit to 1 and the program will wait about 20s/30s after acquiring the critical lock.
To reproduce the problem, run these three queries in three sessions within 30s:
session1:
insert into root.sg1.t1(t) values(1);session2:
delete from root.sg1.t1.**;session3:
select * from root.sg1.**;