Skip to content
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

[IOTDB-2930]Fix concurrent UnPin bug & Improve template implementation #5647

Merged
merged 5 commits into from Apr 23, 2022

Conversation

MarcosZyk
Copy link
Contributor

@MarcosZyk MarcosZyk commented Apr 23, 2022

Description

Fix concurrent UnPin bug

After a thread unPin a node, it should check the cache status of the node. If the node is now not Pinned, then its parent should be unPin once, which means one of the children is not pinned any more. However, the operation and check should be synchronized, otherwise the change may result in multi threads get wrong cache status and do extra unpin, which may result in negative semaphore value.

Improve template implementation

The old implementation of template check during insert takes low performance and is hard to understand. Thus the implementation is rewritten.

@MarcosZyk
Copy link
Contributor Author

MarcosZyk commented Apr 23, 2022

@bigreybear @SilverNarcissus PTAL

Copy link
Contributor

@bigreybear bigreybear left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM~

@MarcosZyk MarcosZyk changed the title [IOTDB-2932]Fix concurrent UnPin bug & Improve template implementation [IOTDB-2930]Fix concurrent UnPin bug & Improve template implementation Apr 23, 2022
@qiaojialin qiaojialin merged commit 9685c5b into apache:master Apr 23, 2022
xinzhongtianxia added a commit to xinzhongtianxia/iotdb that referenced this pull request Apr 24, 2022
* remotes/upstream/master:
  [IOTDB-2996] Fix wildcard import in test folders (apache#5652)
  [IOTDB-2955] Design and implement ClientManager for thrift client's pooling management (apache#5595)
  [IOTDB-2945] Reconstruct ConfigNode manage layer and persistence layer (apache#5627)
  Fix import wildcard violation
  [IOTDB-2933] detect sender exit and set pipestatus=STOP (apache#5557)
  [IOTDB-2989] Expression Serialize & Deserialize (apache#5649)
  [IOTDB-2930]Fix concurrent UnPin bug & Improve template implementation (apache#5647)
  [IOTDB-2984] RatisConsensus Recovery Logic (apache#5648)
  [IOTDB-2979] Optimize the serialization and deserialization of thrift data structures (apache#5637)
  Add config example for new cluster (apache#5624)
  [IOTDB-2982] Recover tsfile after datanode restart (apache#5643)
  Fix TimeJoinNode clone and serde bug (apache#5644)
  Refactor attributes in PlanNode (apache#5616)

# Conflicts:
#	server/src/main/java/org/apache/iotdb/db/mpp/sql/parser/ASTVisitor.java
#	server/src/main/java/org/apache/iotdb/db/mpp/sql/planner/plan/node/metedata/read/SchemaFetchNode.java
#	server/src/main/java/org/apache/iotdb/db/mpp/sql/planner/plan/node/metedata/read/SchemaMergeNode.java
@MarcosZyk MarcosZyk deleted the fix_pin_bug branch May 3, 2022 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants