libceph: subscribe to osdmap when cluster is full
authorSage Weil <sage@newdream.net>
Thu, 12 May 2011 16:29:18 +0000 (09:29 -0700)
committerSage Weil <sage@newdream.net>
Tue, 24 May 2011 18:52:11 +0000 (11:52 -0700)
When the cluster is marked full, subscribe to subsequent map updates to
ensure we find out promptly when it is no longer full.  This will prevent
us from spewing ENOSPC for (much) longer than necessary.

Signed-off-by: Sage Weil <sage@newdream.net>
net/ceph/osd_client.c

index caa092eb00098087b79916375ea3448d2543a221..6ea2b892f44b8ab498cdec7344fc07c73b9a6819 100644 (file)
@@ -1421,6 +1421,15 @@ void ceph_osdc_handle_map(struct ceph_osd_client *osdc, struct ceph_msg *msg)
 done:
        downgrade_write(&osdc->map_sem);
        ceph_monc_got_osdmap(&osdc->client->monc, osdc->osdmap->epoch);
+
+       /*
+        * subscribe to subsequent osdmap updates if full to ensure
+        * we find out when we are no longer full and stop returning
+        * ENOSPC.
+        */
+       if (ceph_osdmap_flag(osdc->osdmap, CEPH_OSDMAP_FULL))
+               ceph_monc_request_next_osdmap(&osdc->client->monc);
+
        send_queued(osdc);
        up_read(&osdc->map_sem);
        wake_up_all(&osdc->client->auth_wq);