~ubuntu-branches/ubuntu/saucy/lvm2/saucy

« back to all changes in this revision

Viewing changes to daemons/cmirrord/cluster.c

  • Committer: Package Import Robot
  • Author(s): Dmitrijs Ledkovs
  • Date: 2013-05-30 11:02:10 UTC
  • mfrom: (3.1.28 sid)
  • Revision ID: package-import@ubuntu.com-20130530110210-q8bou4f333ruwhn0
Tags: 2.02.98-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - debian/patches/avoid-dev-block.patch: Prefer any other device name over
    names in /dev/block/ since lvm.conf won't handle this.
  - debian/rules:
    - copy .po file to .pot file for Rosetta (Ubuntu specific).
  - debian/{dmsetup,lvm2}-udeb.install:
    - install initramfs and udev hooks in udebs (Debian bug 504341).
  - auto-start VGs as their PVs are discovered (Ubuntu specific):
    - add debian/tree/lvm2/lib/udev/rules.d/85-lvm2.rules: use watershed plus
      the sledgehammer of vgscan/vgchange to turn on VGs as they come online.
    - debian/tree/lvm2/usr/share/initramfs-tools/scripts/hooks/lvm2:
      - add 85-lvm2.rules to the list of udev rules to copy.
      - depend on udev.
    - debian/control:
      - add versioned Depend on watershed in lvm2 for udev rules.
      - add Depends on watershed-udeb in lvm2-udeb for udev rules.
      - add versioned Depend/Breaks on udev in dmsetup for udev rules.
      - add Depend on initramfs-tools in dmsetup so system is not potentially
        rendered unbootable by out-of-order dpkg configuration.
      - In libdevmapper-event1.02.1 add Breaks: dmeventd
        (<< 2.02.95-4ubuntu1) due to debian symbol rename
    - debian/rules:
      - do not install local-top scripts since Ubuntu mounts root using udev.
      - do not install init scripts for lvm2, since udev starts LVM.
      - continue to build clvm support.
    - debian/lvm2.postinst: handle missing lvm2 init script.
    - debian/tree/dmsetup/lib/udev/rules.d/60-persistent-storage-dm.rules:
      watch dm devices for changes with inotify
  - add mountroot failure hooks to help fix bad boots (Debian bug 468115):
    - debian/tree/lvm2/usr/share/initramfs-tools/scripts/init-premount/lvm2
  - remaining changes to upstream event manager packages (Debian bug 514706):
    - debian/rules:
      - enable dmeventd during configure.
    - debian/dmeventd.{8,manpages}: install dmeventd files.
  - rename debian/clvm.defaults to debian/clvm.default so it is installed
    correctly.
  - debian/control: add dmsetup-udeb to libdevmapper1.02.1-udeb recommends.
  - debian/rules: make sure dmsetup and lvm2 initramfs-tools scripts are
    executable.  When the Ubuntu-specific ones are added with a patch,
    they may lose their executable bit.
  - Add and install clvmd resource agent
  - Add dependency on libudev-dev to libdevmapper-dev so that the .pc file
    works.
  - debian/{clvmd.ra,clvm.init}:
    - create /run/lvm if it doesn't exist.
  - debian/clvm.init:
    - exit 3 if not running on status action.
  - Call dh_installman so that our dmeventd manpage actually gets installed
  - Install the missing fsadm manpage.
  - Complete libdevmapper-dev multiarch:
    - move .so symlinks and pkgconfig files to multiarched locations.
    - mark libdevmapper-dev M-A: same

* Dropped changes, applied upstream:
  - Update Micron PCIe SSD and other device-types to latest available.
  - Cherry pick from upstream, remove unsupported udev_get_dev_path() call.
  - Move thin check to global section.

Show diffs side-by-side

added added

removed removed

Lines of Context:
89
89
        char *clean_bits;
90
90
        char *recovering_region;
91
91
        struct checkpoint_data *next;
92
 
};      
 
92
};
93
93
 
94
94
#define INVALID 0
95
95
#define VALID   1
910
910
                                   rq->u_rq.seq);
911
911
 
912
912
                        rq->u_rq.data_size = 0;
913
 
                        kernel_send(&rq->u_rq);
914
 
                                
 
913
                        if (kernel_send(&rq->u_rq))
 
914
                                LOG_ERROR("Failed to respond to kernel [%s]",
 
915
                                          RQ_TYPE(rq->u_rq.request_type));
915
916
                        break;
916
 
                        
 
917
 
917
918
                default:
918
919
                        /*
919
920
                         * If an action or a response is required, then
1231
1232
                                   _RQ_TYPE(rq->u_rq.request_type),
1232
1233
                                   rq->originator, (response) ? "YES" : "NO");
1233
1234
                else
1234
 
                        LOG_SPRINT(match, "SEQ#=%u, UUID=%s, TYPE=%s, ORIG=%u, RESP=%s, RSPR=%u",
 
1235
                        LOG_SPRINT(match, "SEQ#=%u, UUID=%s, TYPE=%s, ORIG=%u, RESP=%s, RSPR=%u, error=%d",
1235
1236
                                   rq->u_rq.seq, SHORT_UUID(rq->u_rq.uuid),
1236
1237
                                   _RQ_TYPE(rq->u_rq.request_type),
1237
1238
                                   rq->originator, (response) ? "YES" : "NO",
1238
 
                                   nodeid);
 
1239
                                   nodeid, rq->u_rq.error);
1239
1240
        }
1240
1241
}
1241
1242
 
1248
1249
        uint32_t my_pid = (uint32_t)getpid();
1249
1250
        uint32_t lowest = match->lowest_id;
1250
1251
        struct clog_request *rq;
1251
 
        char dbuf[32];
 
1252
        char dbuf[32] = { 0 };
1252
1253
 
1253
1254
        /* Assign my_cluster_id */
1254
1255
        if ((my_cluster_id == 0xDEAD) && (joined->pid == my_pid))
1264
1265
        if (joined->nodeid == my_cluster_id)
1265
1266
                goto out;
1266
1267
 
1267
 
        memset(dbuf, 0, sizeof(dbuf));
1268
1268
        for (i = 0; i < member_list_entries - 1; i++)
1269
1269
                sprintf(dbuf+strlen(dbuf), "%u-", member_list[i].nodeid);
1270
1270
        sprintf(dbuf+strlen(dbuf), "(%u)", joined->nodeid);
1346
1346
                        dm_list_del(&rq->u.list);
1347
1347
 
1348
1348
                        if (rq->u_rq.request_type == DM_ULOG_POSTSUSPEND)
1349
 
                                kernel_send(&rq->u_rq);
 
1349
                                if (kernel_send(&rq->u_rq))
 
1350
                                        LOG_ERROR("Failed to respond to kernel [%s]",
 
1351
                                                  RQ_TYPE(rq->u_rq.request_type));
1350
1352
                        free(rq);
1351
1353
                }
1352
1354
 
1355
1357
                match->free_me = 1;
1356
1358
                match->lowest_id = 0xDEAD;
1357
1359
                match->state = INVALID;
1358
 
        }                       
 
1360
        }
1359
1361
 
1360
1362
        /* Remove any pending checkpoints for the leaving node. */
1361
1363
        for (p_cp = NULL, c_cp = match->checkpoint_list;
1411
1413
                         left->nodeid);
1412
1414
                return;
1413
1415
        }
1414
 
                
 
1416
 
1415
1417
        match->lowest_id = member_list[0].nodeid;
1416
1418
        for (i = 0; i < member_list_entries; i++)
1417
1419
                if (match->lowest_id > member_list[i].nodeid)
1530
1532
                usleep(1000);
1531
1533
                goto unlink_retry;
1532
1534
        }
1533
 
        
 
1535
 
1534
1536
        if (rv != SA_AIS_OK) {
1535
1537
                LOG_ERROR("[%s] Failed to unlink checkpoint: %s",
1536
1538
                          SHORT_UUID(entry->name.value), str_ais_error(rv));
1633
1635
{
1634
1636
        int r;
1635
1637
        int state;
1636
 
        
 
1638
 
1637
1639
        LOG_COND(log_resend_requests, "[%s] I am leaving.2.....",
1638
1640
                 SHORT_UUID(del->name.value));
1639
1641