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

[#12048] Hot fix for migration #13092

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ private boolean isPreview() {
* Returns whether the account has been migrated.
*/
protected boolean isMigrationNeeded(teammates.storage.entity.Account entity) {
return !entity.isMigrated();
return true;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public class DataMigrationForCourseEntitySql extends DatastoreClient {
AtomicLong numberOfScannedKey;
AtomicLong numberOfUpdatedEntities;

private static final int MAX_RESPONSE_COUNT = 10000;
private static final int MAX_RESPONSE_COUNT = -1;

private VerifyCourseEntityAttributes verifier;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public class DataMigrationForCourseEntitySql50Newest extends DatastoreClient {
AtomicLong numberOfScannedKey;
AtomicLong numberOfUpdatedEntities;

private static final int MAX_RESPONSE_COUNT = 10000;
private static final int MAX_RESPONSE_COUNT = -1;

private VerifyCourseEntityAttributes verifier;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public class DataMigrationForCourseEntitySql50Oldest extends DatastoreClient {
AtomicLong numberOfScannedKey;
AtomicLong numberOfUpdatedEntities;

private static final int MAX_RESPONSE_COUNT = 10000;
private static final int MAX_RESPONSE_COUNT = -1;

private VerifyCourseEntityAttributes verifier;

Expand Down Expand Up @@ -323,6 +323,7 @@ private void migrateFeedbackQuestion(teammates.storage.sqlentity.FeedbackSession
oldResponses = ofy().load().type(FeedbackResponse.class)
.filter("feedbackQuestionId", oldQuestion.getId()).list();
}
log(String.format("Feedback question %d has %d responses associated with it", oldQuestion.getQuestionNumber(), oldResponses.size()));
for (FeedbackResponse oldResponse : oldResponses) {
Section newGiverSection = sectionNameToSectionMap.get(oldResponse.getGiverSection());
Section newRecipientSection = sectionNameToSectionMap.get(oldResponse.getRecipientSection());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,8 @@ private boolean verifyFeedbackQuestion(FeedbackQuestion oldQuestion,
.filter("feedbackQuestionId", oldQuestion.getId()).list();

if (newResponses.size() != oldResponses.size()) {
log(String.format("Mismatched response counts for question %s, session: %s, course id: %s",
log(String.format("Mismatched response counts for question. New: %d, Old: %d, %s, session: %s, course id: %s",
newResponses.size(), oldResponses.size(),
oldQuestion.getQuestionNumber(), oldQuestion.getFeedbackSessionName(), oldQuestion.getCourseId()));
return false;
}
Expand Down