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

Imporove splay delete #312

Merged
merged 5 commits into from
Jun 16, 2022
Merged

Imporove splay delete #312

merged 5 commits into from
Jun 16, 2022

Conversation

Eithea
Copy link
Contributor

@Eithea Eithea commented Jun 16, 2022

What this PR does / why we need it?

There were two problems in deleteNodes.

  1. repeat splay for each node to be deleted resulting in numerous rotations.
  2. not actually delete node, zero-weight node left and affect.

To improve the deletion, this commit skips splay for nodes in between and
isolates in a subtree then cut off the subtree.

Any background context you want to provide?

What are the relevant tickets?

Fixes #

Checklist

  • Added relevant tests or not required
  • Didn't break anything

There were two problems in `deleteNodes`.

1. repeat splay for each node to be deleted resulting in numerous rotations.
2. not actually delete node, zero-weight node left and affect.

To improve the deletion, this commit skips splay for nodes in between and
isolates in a subtree then cut off the subtree.
@codecov
Copy link

codecov bot commented Jun 16, 2022

Codecov Report

Merging #312 (3581d9b) into main (e3a38de) will decrease coverage by 0.04%.
The diff coverage is 79.62%.

@@            Coverage Diff             @@
##             main     #312      +/-   ##
==========================================
- Coverage   87.53%   87.48%   -0.05%     
==========================================
  Files          70       70              
  Lines        4948     4993      +45     
  Branches      497      505       +8     
==========================================
+ Hits         4331     4368      +37     
- Misses        433      441       +8     
  Partials      184      184              
Impacted Files Coverage Δ
src/util/splay_tree.ts 88.35% <71.79%> (-2.73%) ⬇️
src/document/json/rga_tree_split.ts 93.79% <100.00%> (+0.32%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e3a38de...3581d9b. Read the comment docs.

@hackerwins hackerwins self-requested a review June 16, 2022 09:47
Copy link
Member

@hackerwins hackerwins left a comment

Choose a reason for hiding this comment

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

LGTM. 👍

@hackerwins hackerwins merged commit c7749f1 into yorkie-team:main Jun 16, 2022
@Eithea Eithea deleted the imporove-splay-delete branch June 16, 2022 09:51
hackerwins pushed a commit that referenced this pull request Jun 28, 2022
There were some bugs in #312 and #316 after applying range deletion.

1. Deletion does not apply intermittently on remote peers.
2. When typing Korean, intermediate traces remain.
3. Index error when editing the end of the text
4. Randomly occurring runtime errors

This commit fixes most of the bugs in #312 and #316.
Bug 4 was related to the GC, so the GC was modified a little.
hackerwins pushed a commit that referenced this pull request Jun 28, 2022
There were some bugs in #312 and #316 after applying range deletion.

1. Deletion does not apply intermittently on remote peers.
2. When typing Korean, intermediate traces remain.
3. Index error when editing the end of the text
4. Randomly occurring runtime errors

This commit fixes most of the bugs in #312 and #316.
Bug 4 was related to the GC, so the GC was modified a little.
@Eithea Eithea mentioned this pull request Jul 6, 2022
2 tasks
parkeunae pushed a commit to parkeunae/yorkie-js-sdk that referenced this pull request Jul 23, 2022
There were two problems in `deleteNodes`.

1. repeat splay for each node to be deleted resulting in numerous rotations.
2. not actually delete node, zero-weight node left and affect.

To improve the deletion, this commit skips splay for nodes in between and
isolates in a subtree then cut off the subtree.
parkeunae pushed a commit to parkeunae/yorkie-js-sdk that referenced this pull request Jul 23, 2022
There were some bugs in yorkie-team#312 and yorkie-team#316 after applying range deletion.

1. Deletion does not apply intermittently on remote peers.
2. When typing Korean, intermediate traces remain.
3. Index error when editing the end of the text
4. Randomly occurring runtime errors

This commit fixes most of the bugs in yorkie-team#312 and yorkie-team#316.
Bug 4 was related to the GC, so the GC was modified a little.
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.

2 participants