Changeset 429 for trunk/server/source3/lib/ctdbd_conn.c
- Timestamp:
- Apr 9, 2010, 3:51:41 PM (15 years ago)
- Location:
- trunk/server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server
-
Property svn:mergeinfo
set to
/vendor/3.5.2 merged eligible /vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
trunk/server/source3/lib/ctdbd_conn.c
r414 r429 362 362 } 363 363 364 if (msg->srvid == CTDB_SRVID_RECONFIGURE) { 365 DEBUG(0,("Got cluster reconfigure message in ctdb_read_req\n")); 364 if ((msg->srvid == CTDB_SRVID_RECONFIGURE) 365 || (msg->srvid == CTDB_SRVID_SAMBA_NOTIFY)) { 366 367 DEBUG(1, ("ctdb_read_req: Got %s message\n", 368 (msg->srvid == CTDB_SRVID_RECONFIGURE) 369 ? "cluster reconfigure" : "SAMBA_NOTIFY")); 370 366 371 messaging_send(conn->msg_ctx, procid_self(), 367 372 MSG_SMB_BRL_VALIDATE, &data_blob_null); 373 messaging_send(conn->msg_ctx, procid_self(), 374 MSG_DBWRAP_G_LOCK_RETRY, 375 &data_blob_null); 368 376 TALLOC_FREE(hdr); 369 377 goto next_pkt; … … 494 502 } 495 503 504 status = register_with_ctdbd(conn, CTDB_SRVID_SAMBA_NOTIFY); 505 if (!NT_STATUS_IS_OK(status)) { 506 goto fail; 507 } 508 496 509 *pconn = conn; 497 510 return NT_STATUS_OK; … … 500 513 TALLOC_FREE(conn); 501 514 return status; 515 } 516 517 struct messaging_context *ctdb_conn_msg_ctx(struct ctdbd_connection *conn) 518 { 519 return conn->msg_ctx; 520 } 521 522 int ctdbd_conn_get_fd(struct ctdbd_connection *conn) 523 { 524 return packet_get_fd(conn->pkt); 502 525 } 503 526 … … 534 557 SMB_ASSERT(conn->msg_ctx != NULL); 535 558 536 if (msg->srvid == CTDB_SRVID_RECONFIGURE) { 559 if ((msg->srvid == CTDB_SRVID_RECONFIGURE) 560 || (msg->srvid == CTDB_SRVID_SAMBA_NOTIFY)){ 537 561 DEBUG(0,("Got cluster reconfigure message\n")); 538 562 /* 539 * when the cluster is reconfigured, we need to clean the brl 540 * database 563 * when the cluster is reconfigured or someone of the 564 * family has passed away (SAMBA_NOTIFY), we need to 565 * clean the brl database 541 566 */ 542 567 messaging_send(conn->msg_ctx, procid_self(), 543 568 MSG_SMB_BRL_VALIDATE, &data_blob_null); 544 569 545 /* 546 * it's possible that we have just rejoined the cluster after 547 * an outage. In that case our pending locks could have been 548 * removed from the lockdb, so retry them once more 549 */ 550 message_send_all(conn->msg_ctx, MSG_SMB_UNLOCK, NULL, 0, NULL); 570 messaging_send(conn->msg_ctx, procid_self(), 571 MSG_DBWRAP_G_LOCK_RETRY, 572 &data_blob_null); 551 573 552 574 TALLOC_FREE(buf); 553 554 575 return NT_STATUS_OK; 555 576 } … … 1311 1332 } 1312 1333 1334 NTSTATUS ctdb_watch_us(struct ctdbd_connection *conn) 1335 { 1336 struct ctdb_client_notify_register reg_data; 1337 size_t struct_len; 1338 NTSTATUS status; 1339 int cstatus; 1340 1341 reg_data.srvid = CTDB_SRVID_SAMBA_NOTIFY; 1342 reg_data.len = 1; 1343 reg_data.notify_data[0] = 0; 1344 1345 struct_len = offsetof(struct ctdb_client_notify_register, 1346 notify_data) + reg_data.len; 1347 1348 status = ctdbd_control_local( 1349 conn, CTDB_CONTROL_REGISTER_NOTIFY, conn->rand_srvid, 0, 1350 make_tdb_data((uint8_t *)®_data, struct_len), 1351 NULL, NULL, &cstatus); 1352 if (!NT_STATUS_IS_OK(status)) { 1353 DEBUG(1, ("ctdbd_control_local failed: %s\n", 1354 nt_errstr(status))); 1355 } 1356 return status; 1357 } 1358 1359 NTSTATUS ctdb_unwatch(struct ctdbd_connection *conn) 1360 { 1361 struct ctdb_client_notify_deregister dereg_data; 1362 NTSTATUS status; 1363 int cstatus; 1364 1365 dereg_data.srvid = CTDB_SRVID_SAMBA_NOTIFY; 1366 1367 status = ctdbd_control_local( 1368 conn, CTDB_CONTROL_DEREGISTER_NOTIFY, conn->rand_srvid, 0, 1369 make_tdb_data((uint8_t *)&dereg_data, sizeof(dereg_data)), 1370 NULL, NULL, &cstatus); 1371 if (!NT_STATUS_IS_OK(status)) { 1372 DEBUG(1, ("ctdbd_control_local failed: %s\n", 1373 nt_errstr(status))); 1374 } 1375 return status; 1376 } 1377 1313 1378 #else 1314 1379
Note:
See TracChangeset
for help on using the changeset viewer.