Changeset 8937
- Timestamp:
- 07/12/11 15:09:48 (23 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
branches/orange-next/src/server/create-immutable-copies.sm
r8935 r8937 24 24 25 25 /*all bits turned on*/ 26 static uint64_t UINT64_HIGH = 0xffffffffffffffffULL; 26 //static uint64_t UINT64_HIGH = 0xffffffffffffffffULL; 27 static const uuid_t UUID_INIT; 28 PVFS_handle_generate(UUID_INIT); 27 29 28 30 /*attribute keys used for the mirroring process*/ … … 228 230 } 229 231 230 gossip_debug(GOSSIP_MIRROR_DEBUG,"\tdfile_count: %d\tmetadata_handle: %llu" 232 memset(PVFS_handle_string,0,PVFS_HANDLE_STRING_LENGTH); 233 PVFS_handle_unparse(imm_p->metadata_handle,PVFS_handle_string); 234 gossip_debug(GOSSIP_MIRROR_DEBUG,"\tdfile_count: %d\tmetadata_handle: %s" 231 235 "\tfs_id: %u" 232 236 "\tio_servers_count: %d\n" 233 237 ,imm_p->dfile_count 234 , llu(imm_p->metadata_handle)238 ,PVFS_handle_string 235 239 ,imm_p->fs_id 236 240 ,imm_p->io_servers_count ); … … 583 587 goto error_exit; 584 588 } 589 memset(PVFS_handle_string,0,PVFS_HANDLE_STRING_LENGTH); 590 PVFS_handle_unparse(imm_p->handle_array_base[i],PVFS_handle_string); 585 591 gossip_debug(GOSSIP_MIRROR_DEBUG,"\tValue of server_name is %s " 586 "for handle % llu\n"592 "for handle %s\n" 587 593 ,imm_p->io_servers[i] 588 , llu(imm_p->handle_array_base[i]));594 ,PVFS_handle_string); 589 595 }/*end for*/ 590 596 … … 633 639 634 640 imm_p->handle_array_base_local_count++; 635 gossip_debug(GOSSIP_MIRROR_DEBUG,"\tlocal source handle(%d):%llu\n" 641 PVFS_handle_unparse(imm_p->handle_array_base_local[imm_p->handle_array_base_local_count 642 ,PVFS_handle_string); 643 gossip_debug(GOSSIP_MIRROR_DEBUG,"\tlocal source handle(%d):%s\n" 636 644 ,imm_p->handle_array_base_local_count 637 ,llu(imm_p->handle_array_base_local[imm_p->handle_array_base_local_count]));645 ,PVFS_handle_string); 638 646 } 639 647 … … 1057 1065 return SM_ACTION_COMPLETE; 1058 1066 } 1059 memset(imm_p->writes_completed,UINT64_HIGH,sizeof(PVFS_handle) 1060 * imm_p->dfile_count 1061 * imm_p->copies); 1067 for (i=0; i<(imm_p->dfile_count * imm_p->copies); i++) 1068 PVFS_handle_copy(imm_p->writes_completed[i],UUID_INIT); 1069 //memset(imm_p->writes_completed,UINT64_HIGH,sizeof(PVFS_handle) 1070 // * imm_p->dfile_count 1071 // * imm_p->copies); 1062 1072 1063 1073 /*the retry count is used to monitor how many times we retry a write. */ … … 1080 1090 int src,row,cols,i,index,wc; 1081 1091 1092 char PVFS_handle_string[PVFS_HANDLE_STRING_LEN]; 1093 1082 1094 /*this variable helps to understand the logic better. it is a redeclara- */ 1083 1095 /*tion of the one dimensional imm_p->handle_array_copies and can be ac- */ … … 1094 1106 { 1095 1107 for (cols=0; cols<imm_p->io_servers_required; cols++) 1108 { 1109 memset(PVFS_handle_string,0,PVFS_HANDLE_STRING_LEN); 1110 PVFS_handle_unparse(handle_array_copies[row][cols],PVFS_handle_string); 1096 1111 gossip_debug(GOSSIP_MIRROR_DEBUG,"\t\thandle_array_copies[%d][%d] : " 1097 "% llu\n"1112 "%sn" 1098 1113 ,row,cols 1099 ,llu(handle_array_copies[row][cols])); 1114 ,PVFS_handle_string); 1115 } 1100 1116 } 1101 1117 … … 1117 1133 /* cleanup and fix */ 1118 1134 /*this will capture UINT64_HIGH or handle*/ 1119 /* 1120 if ( imm_p->writes_completed[index] > 0 1121 || imm_p->writes_completed[index] == UINT64_HIGH) 1135 if ( (PVFS_handle_compare(imm_p->writes_completed[index],UUID_INIT) == 0) 1136 || !(PVFS_handle_is_null(imm_p->writes_completed[index]) ) 1137 //if ( imm_p->writes_completed[index] > 0 1138 // || imm_p->writes_completed[index] == UINT64_HIGH) 1122 1139 break; 1123 */1124 1140 } 1125 1141 … … 1177 1193 index = imm_p->copies*src; /*first copy for this source*/ 1178 1194 1179 /* cleanup and fix 1180 if (imm_p->writes_completed[index] == UINT64_HIGH) 1181 */ 1182 if( 1 ) 1195 //if (imm_p->writes_completed[index] == UINT64_HIGH) 1196 if ( PVFS_handle_compare(imm_p->writes_completed[index],UUID_INIT) == 0 ) 1183 1197 { 1184 1198 /*handle_array_copies[copy,server#] is accessed as a two-dimensional*/ … … 1201 1215 { 1202 1216 index = (imm_p->copies*row) + cols; 1203 if (imm_p->writes_completed[index] > 0) 1217 //if (imm_p->writes_completed[index] > 0) 1218 if ( !PVFS_handle_is_null(imm_p->writes_completed[index]) ) 1204 1219 { 1205 1220 PVFS_handle_copy(req->u.mirror.dst_handle[i], … … 1216 1231 req->u.mirror.encoding = fs->encoding; 1217 1232 1218 gossip_debug(GOSSIP_MIRROR_DEBUG,"\treq->: src:%llu\tfs_id:%d" 1233 memset(PVFS_handle_string,0,PVFS_HANDLE_STRING_LEN); 1234 PVFS_handle_unparse(req->u.mirror.src_handle,PVFS_handle_string); 1235 gossip_debug(GOSSIP_MIRROR_DEBUG,"\treq->: src:%s\tfs_id:%d" 1219 1236 "\tdist name:%s\tsrc server_nr:%d\n" 1220 , llu(req->u.mirror.src_handle)1237 ,PVFS_handle_string 1221 1238 ,req->u.mirror.fs_id 1222 1239 ,req->u.mirror.dist->dist_name 1223 1240 ,req->u.mirror.src_server_nr ); 1224 1241 for (i=0; i<req->u.mirror.dst_count; i++) 1225 gossip_debug(GOSSIP_MIRROR_DEBUG,"\treq->dst_handle[%d] : %llu\n" 1242 { 1243 memset(PVFS_handle_string,0,PVFS_HANDLE_STRING_LEN); 1244 PVFS_handle_unparse(req->u.mirror.dst_handle[i],PVFS_handle_string); 1245 gossip_debug(GOSSIP_MIRROR_DEBUG,"\treq->dst_handle[%d] : %s\n" 1226 1246 ,i 1227 , llu(req->u.mirror.dst_handle[i]));1228 1247 ,PVFS_handle_string); 1248 } 1229 1249 struct PINT_server_op *mirror_op = 1230 1250 malloc(sizeof(struct PINT_server_op)); … … 1293 1313 } 1294 1314 1315 memset(PVFS_handle_string,0,PVFS_HANDLE_STRING_LEN); 1316 PVFS_handle_unparse(msg_p->handle,PVFS_handle_string); 1295 1317 gossip_debug(GOSSIP_MIRROR_DEBUG,"\tmsg_p->req.op:%d" 1296 1318 "\tmsg_p->fs_id:%d" 1297 "\tmsg_p->handle:% llu\n"1319 "\tmsg_p->handle:%s\n" 1298 1320 ,msg_p->req.op 1299 1321 ,msg_p->fs_id 1300 , llu(msg_p->handle));1322 ,PVFS_handle_string ); 1301 1323 1302 1324 PINT_sm_push_frame(smcb, REMOTE_SRC, mirror_op); … … 1321 1343 struct PVFS_servresp_mirror *respmir = NULL; 1322 1344 struct PVFS_servreq_mirror *reqmir = NULL; 1345 char PVFS_handle_string[PVFS_HANDLE_STRING_LEN] = {0}; 1323 1346 1324 1347 gossip_debug(GOSSIP_MIRROR_DEBUG,"\tjs_p->error_code:%d\n" … … 1347 1370 ,error_code,error_code 1348 1371 ,remaining); 1349 gossip_debug(GOSSIP_MIRROR_DEBUG,"\tresp.src_handle:%llu " 1372 memset(PVFS_handle_string,0,PVFS_HANDLE_STRING_LEN); 1373 PVFS_handle_unparse(respmir->src_handle,PVFS_handle_string); 1374 gossip_debug(GOSSIP_MIRROR_DEBUG,"\tresp.src_handle:%s " 1350 1375 "\tresp.src_server_nr:%d\n" 1351 ,llu(respmir->src_handle)1352 ,respmir->src_server_nr );1376 ,PVFS_handle_string 1377 ,respmir->src_server_nr ); 1353 1378 for (i=0; i<respmir->dst_count; i++) 1354 1379 { … … 1404 1429 && respmir->write_status_code[i] == 0) 1405 1430 { 1406 /* cleanup and fix 1407 imm_p->writes_completed[index] = 0; 1408 */ 1409 assert(0); 1431 //imm_p->writes_completed[index] = 0; 1432 PVFS_handle_clear(imm_p->writes_completed[index]); 1410 1433 } else if (error_code == 0) 1411 1434 { … … 1414 1437 } else 1415 1438 { 1416 /* cleanup and fix 1417 imm_p->writes_completed[index] = UINT64_HIGH; 1418 */ 1419 assert(0); 1439 //imm_p->writes_completed[index] = UINT64_HIGH; 1440 PVFS_handle_copy(imm_p->writes_completed[index],UUID_INIT); 1420 1441 } 1421 1442 } … … 1468 1489 { 1469 1490 index = (imm_p->dfile_count * i) + j; 1470 gossip_debug(GOSSIP_MIRROR_DEBUG,"\t\t[%d][%d]:%llu\n" 1491 char PVFS_handle_string[PVFS_HANDLE_STRING_LEN]; 1492 uuid_unparse(imm_p->writes_completed[index],PVFS_handle_string); 1493 gossip_debug(GOSSIP_MIRROR_DEBUG,"\t\t[%d][%d]:%s\n" 1471 1494 ,i,j 1472 ,llu(imm_p->writes_completed[index])); 1495 ,PVFS_handle_string); 1496 //gossip_debug(GOSSIP_MIRROR_DEBUG,"\t\t[%d][%d]:%llu\n" 1497 // ,i,j 1498 // ,llu(imm_p->writes_completed[index])); 1473 1499 } 1474 1500 } … … 1498 1524 for (i=0; i<(imm_p->dfile_count * imm_p->copies); i++) 1499 1525 { 1500 gossip_debug(GOSSIP_MIRROR_DEBUG,"\twrites_complete[%d]:%llu\n" 1501 ,i,llu(imm_p->writes_completed[i])); 1502 if (imm_p->writes_completed[i] != 0) 1526 char PVFS_handle_string[PVFS_handle_string_len] = {0}; 1527 PVFS_handle_unparse(imm_p->writes_completed[i],PVFS_handle_string); 1528 gossip_debug(GOSSIP_MIRROR_DEBUG,"\twrites_complete[%d]:%s\n" 1529 ,i,PVFS_handle_string); 1530 //if (imm_p->writes_completed[i] != 0) 1531 if ( !PVFS_handle_is_null(imm_p->writes_completed[i]) ) 1503 1532 { 1504 1533 js_p->error_code = RETRY; … … 1599 1628 ,sm_p->key_a[i].buffer_sz); 1600 1629 PVFS_handle *myHandle = (PVFS_handle *)sm_p->val_a[i].buffer; 1630 char PVFS_handle_string[PVFS_HANDLE_STRING_LEN]; 1601 1631 for (j=0; j<(imm_p->dfile_count*imm_p->copies); j++) 1602 1632 { 1603 gossip_debug(GOSSIP_MIRROR_DEBUG,"\t\thandle(%d):%llu\n" 1633 memset(PVFS_handle_string,0,PVFS_HANDLE_STRING_LEN); 1634 PVFS_handle_unparse(myHandle[j],PVFS_handle_string); 1635 gossip_debug(GOSSIP_MIRROR_DEBUG,"\t\thandle(%d):%s\n" 1604 1636 ,j 1605 , llu(myHandle[j]));1637 ,PVFS_handle_string); 1606 1638 } 1607 1639 … … 1620 1652 for (j=0; j<(imm_p->dfile_count * imm_p->copies); j++) 1621 1653 { 1622 gossip_debug(GOSSIP_MIRROR_DEBUG,"\thandle(%d):status(%llu)\n" 1654 memset(PVFS_handle_string,0,PVFS_HANDLE_STRING_LEN); 1655 PVFS_handle_unparse(myStatus[j],PVFS_handle_string); 1656 gossip_debug(GOSSIP_MIRROR_DEBUG,"\thandle(%d):status(%s)\n" 1623 1657 ,j 1624 , llu(myStatus[j]));1658 ,PVFS_handle_string); 1625 1659 } 1626 1660 … … 1649 1683 { 1650 1684 PVFS_handle *myHandle = (PVFS_handle *)sm_p->val_a[i].buffer; 1651 gossip_debug(GOSSIP_MIRROR_DEBUG,"\t\thandle(%d):%llu\n" 1685 memset(PVFS_handle_string,0,PVFS_HANDLE_STRING_LEN); 1686 PVFS_handle_unparse(myHandle[j],PVFS_handle_string); 1687 gossip_debug(GOSSIP_MIRROR_DEBUG,"\t\thandle(%d):%s\n" 1652 1688 ,j 1653 , llu(myHandle[j]));1689 ,PVFS_handle_string); 1654 1690 } 1655 1691 … … 1701 1737 if (js_p->error_code) 1702 1738 { 1739 memset(PVFS_handle_string,0,PVFS_HANDLE_STRING_LENGTH); 1740 PVFS_handle_unparse(imm_p->metadata_handle); 1703 1741 gossip_err("Unable to store datahandles and number of copies for this " 1704 1742 "mirror operation.\n"); 1705 gossip_err("\tMeta data handle is % llu\n",llu(imm_p->metadata_handle));1743 gossip_err("\tMeta data handle is %s\n",PVFS_handle_string); 1706 1744 return SM_ACTION_COMPLETE; 1707 1745 } … … 1926 1964 return(resp_p->status); 1927 1965 1928 gossip_debug(GOSSIP_MIRROR_DEBUG,"\tresp->src_handle:%llu " 1966 memset(PVFS_handle_string,0,PVFS_HANDLE_STRING_LEN); 1967 PVFS_handle_unparse(resp_p->u.mirror.src_handle,PVFS_handle_string); 1968 gossip_debug(GOSSIP_MIRROR_DEBUG,"\tresp->src_handle:%s " 1929 1969 "\tresp->src_server_nr:%d " 1930 1970 "\tresp->status:%d\n" 1931 , llu(resp_p->u.mirror.src_handle)1971 ,PVFS_handle_string 1932 1972 ,resp_p->u.mirror.src_server_nr 1933 1973 ,resp_p->status ); … … 2006 2046 for (i=0; i<(in_cols*rows); i++) 2007 2047 { 2008 gossip_debug(GOSSIP_MIRROR_DEBUG,"\thandle_array_copies(%d):%llu\n" 2048 memset(PVFS_handle_string,0,PVFS_HANDLE_STRING_LEN); 2049 PVFS_unparse(copies_in[i],PVFS_handle_string); 2050 gossip_debug(GOSSIP_MIRROR_DEBUG,"\thandle_array_copies(%d):%s\n" 2009 2051 ,(int)i 2010 , llu(copies_in[i]));2052 ,PVFS_handle_string); 2011 2053 } 2012 2054 … … 2028 2070 for (j=0; j<out_cols; j++) 2029 2071 { 2030 gossip_debug(GOSSIP_MIRROR_DEBUG,"\t\t(%d,%d):%llu\n" 2072 memset(PVFS_handle_string,0,PVFS_HANDLE_STRING_LENGTH); 2073 PVFS_handle_unparse(copies_out[(i*out_cols)+j],PVFS_handle_string); 2074 gossip_debug(GOSSIP_MIRROR_DEBUG,"\t\t(%d,%d):%s\n" 2031 2075 ,(int)i,(int)j 2032 , llu(copies_out[(i*out_cols)+j]));2076 ,PVFS_handle_string); 2033 2077 } 2034 2078 }
