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

Fix unload record #2870

Closed
wants to merge 1 commit into from
Closed

Fix unload record #2870

wants to merge 1 commit into from

Conversation

drogus
Copy link
Contributor

@drogus drogus commented Mar 12, 2015

This targets #2859 and #2862. When I started my work on this I only wanted to fix #2859, but both issues are connected and I believe that it's better to fix them at once. You can't easily change transitioning to deleted.saved without doing something else that removes record from record arrays, which can be achieved by destroying a record. Additionally, destroying a record on unloading without dematerializing it doesn't really make sense, so I also added that.

One more thing that should be a motivation for this change is that dematerializeRecord and it mentions using unloadRecord, which isn't an equivalent at the moment.

@drogus drogus force-pushed the fix-unload-record branch 2 times, most recently from 2dd9918 to ff85a35 Compare March 12, 2015 21:29
There are a few inconsistencies in how unload record works:

  * it differs from unloadAll, because it doesn't destroy records
  * it sets a record in deleted.saved state, which may be wrong if you
    want to unload record, which is not actually deleted
  * it doesn't dematerialize records, so they're not garbage collected and
    stay in the `idToRecord` array forever (which may also cause
    problems if you want to load a record with the same id later)

This commit fixes these issues by calling _dematerializeRecord and
destroy when unloading a record.
@drogus
Copy link
Contributor Author

drogus commented Mar 12, 2015

I should probably add that currently the tests fail, because we don't remove records from record arrays when a record is destroyed or when it's destroying. It will pass once #2867 is fixed.

@igorT igorT mentioned this pull request Apr 20, 2015
28 tasks
@drogus
Copy link
Contributor Author

drogus commented Jul 21, 2015

@igorT is this thing still needed? I haven't followed ED development lately, so I'm not sure how it looks like in context of other changes.

@tchak
Copy link
Member

tchak commented Jul 21, 2015

@drogus I would say that yes it is still needed. But now there a record and internal-record to deal with.

@krisselden was asking about exactly this today in slack :)

@fivetanley
Copy link
Member

@drogus do you have the bandwidth to pick this back up?

@drogus
Copy link
Contributor Author

drogus commented Jan 6, 2016

@fivetanley yup, although I would need to get familiar with ED internals again. I can look at it over the weekend. Do you know if the algorithm that @igorT outlined here is still up to date?

@sly7-7
Copy link
Contributor

sly7-7 commented Jan 7, 2016

There was also a work done by @igorT #3301, and I've added a test. Not sure how this is related, and I can't remember what was missing for the test to pass.

@bmac
Copy link
Member

bmac commented Mar 27, 2016

@drogus Looks like #2867 is now fixed. What needs to happen to get this pr into a place where it can be merged?

@bmac
Copy link
Member

bmac commented Jun 24, 2016

@drogus Do you know needs to happen to get this pr into a place where it can be merged?

@bmac
Copy link
Member

bmac commented Jul 11, 2016

I'm going to close this issue since there hasn't been any response in a while. Feel free to reopen if there is an update.

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.

Unloading a record sets isDeleted to true
6 participants