-
Notifications
You must be signed in to change notification settings - Fork 38
Clear state option #34
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
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 |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # -*- coding: utf-8 -*- | ||
| from __future__ import unicode_literals | ||
|
|
||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ('submissions', '0002_auto_20151119_0913'), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.AlterField( | ||
| model_name='submission', | ||
| name='student_item', | ||
| field=models.ForeignKey(to='submissions.StudentItem', null=True, default=1), | ||
| preserve_default=False | ||
| ), | ||
| ] | ||
|
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. One potential issue I've discovered during dev testing - trying to reverse this migration after NULL values have been added results in an error, so I'll have to figure that out, at least.
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. @maxrothman Here's some data from running this migration on my devstack with ~1400 rows of data, the read-replica indicates ~670,000 on production https://gist.github.com/efischer19/b56b9d14768de28cf612 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. @efischer19 Do you feel those results are representative enough to indicate lack of an issue with ~100x rows?
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. I think so. The two longest lines seem to be these, what else should we be considering when extrapolating? There's also now a possibility of avoiding migrations entirely if the approach in #35 wins out as our best option. |
||
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.
@mulby We're a little curious about how this will impact analytics.
Essentially what happens on a "reset state" request is that we leave the
Submissionitem in the database, and when theStudentModuleis deleted (https://github.com/edx/edx-platform/blob/master/lms/djangoapps/instructor/enrollment.py#L246-L253), the only possible reference to the submission (via its uuid) is lost.However, with the addition of staff tools, now a third party (the staff user) can construct a triplet of (user/course/problem location) and use that as a key to access a supposedly orphaned submission. The way we're attempting to address the issue in this PR is to null out the key for an orphaned submission, which will then be persisted in the database.
Will this be an issue for analytics? It will make it possible for
Submissiondata to exist that cannot be easily linked to a student. Would adding events coverage make it any better?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.
An alternative approach is #35, where we mangle the key instead of deleting it. The course and student information would remain intact, but the problem identifier is reversed.
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.
I'm not sure how valuable it is to keep the data if it can't actually be associated with the original student anymore.
Are we confident we have good event log coverage of this?
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.
I'm not sure how thorough the event coverage is, but see my latest comment on #35. We may be able to keep the original student association mostly intact.