Teammates: Run script to migrate rubric question weight from 1-d list to 2-d list

Created on 12 Aug 2018  路  5Comments  路  Source: TEAMMATES/teammates

Related to #9008

DataMigrationForRubricQuestionsWithWeightsAttached.java in the current master branch should be run in order to do the migration.

a-Storage c.Task

Most helpful comment

Ran the script. Output:

Total number of keys: 12717
Number of affected keys: 1082
Number of updated keys: 1082

All 5 comments

@xpdavid @damithc I guess there is a major bug in the migration script

I was running the script to migrate the data in my dev server. First I ran the script in preview mode. and the output was:

--- Starting remote operation ---
Going to connect to:localhost:8080
Running teammates.client.scripts.DataMigrationForRubricQuestionsWithWeightsAttached...
Preview: true
Total number of keys: 25
Number of affected keys: 8
Number of updated keys: 0
--- Remote operation completed ---

Then when I ran the script again but this time not in preview mode and I got the output I was expecting.

--- Starting remote operation ---
Going to connect to:localhost:8080
Running teammates.client.scripts.DataMigrationForRubricQuestionsWithWeightsAttached...
Preview: false
Total number of keys: 25
Number of affected keys: 8
Number of updated keys: 8
--- Remote operation completed ---

But the weird thing happened when I ran the script again in preview mode expecting the numberOfAffectedKeys will be 0, as all data has been migrated, but the output was this

--- Starting remote operation ---
Going to connect to:localhost:8080
Running teammates.client.scripts.DataMigrationForRubricQuestionsWithWeightsAttached...
Preview: true
Total number of keys: 33
Number of affected keys: 8
Number of updated keys: 0
--- Remote operation completed ---

Total number of keys increased by 8. I am not sure why this is happening. I guess there is a fault in the script that is creating new entities where it should update the existing ones?

Confirmed, please don't run the script right now :( @damithc

It turns out we should use new FeedbackResponsesDb().updateFeedbackResponseOptimized()

Sorry for not picking up this during review time :(

Checked and run against my own staging server. Looks fine.
Ready to be run @damithc

Ran the script. Output:

Total number of keys: 12717
Number of affected keys: 1082
Number of updated keys: 1082

Was this page helpful?
0 / 5 - 0 ratings