Github user hsyuan commented on a diff in the pull request: https://github.com/apache/incubator-hawq/pull/1187#discussion_r108030444 --- Diff: src/backend/access/appendonly/appendonlywriter.c --- @@ -923,30 +923,34 @@ usedByConcurrentTransaction(AOSegfileStatus *segfilestat) */ int addCandidateSegno(AOSegfileStatus **maxSegno4Seg, int segment_num, AOSegfileStatus *candidate_status, bool isKeepHash) -{ +{ + int remaining_num = segment_num; if(isKeepHash){ - int remaining_num = segment_num; int idx = (candidate_status->segno+segment_num-1) % segment_num; // from 1 to segment_num-1, then 0(segment_num) if (NULL==maxSegno4Seg[idx] || maxSegno4Seg[idx]->segno > candidate_status->segno) //using the min seg no firstly. maxSegno4Seg[idx] = candidate_status; for(int i=0; i<segment_num; i++) { if(NULL!=maxSegno4Seg[i] && maxSegno4Seg[i]->segno > 0){ - remaining_num--; + remaining_num--; } } - return remaining_num; }else{ + bool assigned = false; // candidate_status assigned? + remaining_num = 0; for(int i=0; i<segment_num; i++){ --- End diff -- ```c for(int i=0; i<segment_num; i++) ``` To ```c for (int i = 0; i < segment_num; i++) ````
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---