]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librados: expose OPERATION_FULL_TRY flag
authorSage Weil <sage@redhat.com>
Thu, 1 Oct 2015 19:03:22 +0000 (15:03 -0400)
committerSage Weil <sage@redhat.com>
Thu, 1 Oct 2015 19:03:22 +0000 (15:03 -0400)
Allow librados users to opt to receive ENOSPC or EDQUOT when they submit
an operation against a full cluster.  This should only be used if the
librados app can handle those errors gracefully (librbd, for example,
cannot).

Also note that this allows savvy librados users to send delete operations;
they will get either a success or EDQUOT, depending on whether the
operation results in a net drop in space utilization.

Signed-off-by: Sage Weil <sage@redhat.com>
PendingReleaseNotes
src/include/rados/librados.h
src/include/rados/librados.hpp
src/librados/librados.cc

index 92a220b94ab78e85f2afd1c58b1a4aac7cb1f29d..bfa868e3ee95f4210d9c1be9db6fb8180776e1f9 100644 (file)
@@ -1,6 +1,13 @@
 v9.1.0
 ======
 
+* When a pool quota is reached, librados operations now block indefinitely,
+  the same way they do when the cluster fills up.  (Previously they would return
+  -ENOSPC).  By default, a full cluster or pool will now block.  If your
+  librados application can handle ENOSPC or EDQUOT errors gracefully, you can
+  get error returns instead by using the new librados OPERATION_FULL_TRY flag.
+
+
 v9.0.4
 ======
 
index 8d8d11b4ba03404e1f338e1a38f9f1458afea401..ab85da23f299c8a81f05f209833b554dfba659d5 100644 (file)
@@ -120,6 +120,7 @@ enum {
   LIBRADOS_OPERATION_IGNORE_CACHE       = 8,
   LIBRADOS_OPERATION_SKIPRWLOCKS        = 16,
   LIBRADOS_OPERATION_IGNORE_OVERLAY     = 32,
+  LIBRADOS_OPERATION_FULL_TRY           = 64,
 };
 /** @} */
 
index dfe22e9226c68a62da9325b63d83b7340f3c7983..9ca8368dd1ddf528843a602be7b63e5a30deb4a2 100644 (file)
@@ -265,6 +265,7 @@ namespace librados
     OPERATION_IGNORE_CACHE       = LIBRADOS_OPERATION_IGNORE_CACHE,
     OPERATION_SKIPRWLOCKS        = LIBRADOS_OPERATION_SKIPRWLOCKS,
     OPERATION_IGNORE_OVERLAY     = LIBRADOS_OPERATION_IGNORE_OVERLAY,
+    OPERATION_FULL_TRY           = LIBRADOS_OPERATION_FULL_TRY,
   };
 
   /*
index 6418ae23054d93a7c1517d27060acc54f68b826f..52445ad4dcb3c8ed4a180f9e70ddecac998ab13f 100644 (file)
@@ -1319,6 +1319,8 @@ static int translate_flags(int flags)
     op_flags |= CEPH_OSD_FLAG_SKIPRWLOCKS;
   if (flags & librados::OPERATION_IGNORE_OVERLAY)
     op_flags |= CEPH_OSD_FLAG_IGNORE_OVERLAY;
+  if (flags & librados::OPERATION_FULL_TRY)
+    op_flags |= CEPH_OSD_FLAG_FULL_TRY;
 
   return op_flags;
 }