Skip to contentSkip to conversation

ceph.git branch librados_api updated. v0.24.3-788-gd15fe7f

ceph-commit Gregory Farnum 4 participants 12 messages Feb 25, 2011 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

On Thursday, February 24, 2011 at 6:19 PM, Colin McCabe wrote:
The branch, librados_api has been updated

Quoted 53 lines

via d15fe7f90bf488c6251be4633b104a822ebd134f (commit) from e3f3177febf07bf3b311414167fdf4ccbf07c472 (commit)

Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.

http://ceph.newdream.net/git/?p=ceph.git;a=commit;h=d15fe7f90bf488c6251be4633b104a822ebd134f

- Log ----------------------------------------------------------------- commit d15fe7f90bf488c6251be4633b104a822ebd134f
Author: Colin Patrick McCabe <[email protected]>
Date: Thu Feb 24 10:13:09 2011 -0800

rollback rename

---

 src/include/rados/librados.h | 4 ++--
 src/librados.cc | 5 ++---
 2 files changed, 4 insertions(+), 5 deletions(-)
src/include/rados/librados.h +2 -2
index d220cad..f63b58a 100644
@@ -120,8 +120,8 @@ void rados_objects_list_close(rados_list_ctx_t ctx);
 /* snapshots */
 int rados_pool_snap_create(rados_pool_t pool, const char *snapname);
 int rados_pool_snap_remove(rados_pool_t pool, const char *snapname);
-int rados_pool_snap_rollback_object(rados_pool_t pool, const char *oid,
- const char *snapname);
+int rados_rollback(rados_pool_t pool, const char *oid,
+ const char *snapname);
 void rados_pool_snap_set_read(rados_pool_t pool, rados_snap_t snap);
 int rados_pool_selfmanaged_snap_create(rados_pool_t pool, uint64_t *snapid);
 int rados_pool_selfmanaged_snap_remove(rados_pool_t pool, uint64_t snapid);
src/librados.cc +2 -3
index a819ebb..c1e81b2 100644
@@ -2674,9 +2674,8 @@ extern "C" int rados_pool_snap_remove(rados_pool_t pool, const char *snapname)
 return ctx->client->snap_remove(ctx, snapname);
 }
 
-extern "C" int rados_pool_snap_rollback_object(rados_pool_t pool,
- const char *oid,
- const char *snapname)
+extern "C" int rados_rollback(rados_pool_t pool, const char *oid,
+ const char *snapname)
 {
 RadosClient::PoolCtx *ctx = (RadosClient::PoolCtx *)pool;
 return ctx->client->snap_rollback_object(ctx, oid, snapname);
Quoted 5 lines

_______________________________________________
Ceph-commit mailing list
[email protected]
http://lists.ceph.newdream.net/listinfo.cgi/ceph-commit-ceph.newdream.net

I think you guys talked about this yesterday -- sorry I missed it -- but what's the logic behind this new name "rados_rollback"? It's not quite working for me -- I think because it lacks the noun. :) Could we at least do rados_object_rollback()? Or even rados_object_rollback_to_snap()?

#2 lore raw
Quoted 5 lines · Gregory Farnum

I think you guys talked about this yesterday -- sorry I missed it -- but what's the logic behind this new name "rados_rollback"? It's not quite working for me -- I think because it lacks the noun. :) Could we at least do rados_object_rollback()? Or even rados_object_rollback_to_snap()?

It matches rados_write, read, remove, etc. Either they all get
rados_object_ prefix or none do. I'm fine with either...

sage

#3 lore raw

I kind of want to prefix all the object operations with "obj_" just to make things clear. Then it would be rados_obj_rollback() / PoolHandle::obj_rollback().
What do you think?

Colin

Quoted 7 lines · Sage Weil
Quoted 5 lines · Gregory Farnum

I think you guys talked about this yesterday -- sorry I missed it -- but what's the logic behind this new name "rados_rollback"? It's not quite working for me -- I think because it lacks the noun. :) Could we at least do rados_object_rollback()? Or even rados_object_rollback_to_snap()?

Quoted 5 lines

It matches rados_write, read, remove, etc.   Either they all get rados_object_ prefix or none do.  I'm fine with either...

sage

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw
Quoted 5 lines · Colin Patrick McCabe

I kind of want to prefix all the object operations with "obj_" just to make things clear. Then it would be rados_obj_rollback() / PoolHandle::obj_rollback().
What do you think?

The 'o' in rados stands for object.

Yehuda

#5 lore raw
Quoted 9 lines · Yehuda Sadeh Weinraub
Quoted 5 lines · Colin Patrick McCabe

I kind of want to prefix all the object operations with "obj_" just to make things clear. Then it would be rados_obj_rollback() / PoolHandle::obj_rollback().
What do you think?

The 'o' in rados stands for object.

We're definitely moving into bikeshedding territory now, but one thing Yehuda suggested:

The pool handle (rados_pool_t, PoolHandle) has state associated with it, including the snap to read from or snap context to write with. That's not obvious from the name. Maybe it should be renamed rados_ioctx_t to be more clear. Then the pool we're reading to/writing from becomes one more piece of state associated with the handle.

sage

#6 lore raw
Quoted 8 lines · Sage Weil

We're definitely moving into bikeshedding territory now, but one thing Yehuda suggested:

The pool handle (rados_pool_t, PoolHandle) has state associated with it, including the snap to read from or snap context to write with.  That's not obvious from the name.  Maybe it should be renamed rados_ioctx_t to be more clear.  Then the pool we're reading to/writing from becomes one more piece of state associated with the handle.

PoolHandle in the C++ API and pool_t in the C API map onto RadosClient::PoolCtx, which contains the aforementioned state. So if we change this in the C++ API, we should change it all the way through, and rename pool_t, RadosClient::PoolCtx, etc.

Should we? I could go either way. The concept of a handle itself having properties is not really unfamiliar. After all, two different processes can open two different file descriptors referring to the same file, but one with O_RDONLY, and the other with O_WRONLY. etc. A handle to a thing is not the same as the thing itself.

Colin
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#7 lore raw
Quoted 15 lines · Colin Patrick McCabe
Quoted 8 lines · Sage Weil

We're definitely moving into bikeshedding territory now, but one thing Yehuda suggested:

The pool handle (rados_pool_t, PoolHandle) has state associated with it, including the snap to read from or snap context to write with.  That's not obvious from the name.  Maybe it should be renamed rados_ioctx_t to be more clear.  Then the pool we're reading to/writing from becomes one more piece of state associated with the handle.

PoolHandle in the C++ API and pool_t in the C API map onto RadosClient::PoolCtx, which contains the aforementioned state. So if we change this in the C++ API, we should change it all the way through, and rename pool_t, RadosClient::PoolCtx, etc.

Quoted 6 lines

Should we? I could go either way. The concept of a handle itself having properties is not really unfamiliar. After all, two different processes can open two different file descriptors referring to the same file, but one with O_RDONLY, and the other with O_WRONLY. etc. A handle to a thing is not the same as the thing itself.

But in the case of two different files, it is clear that you're opening a specific file. A pool handle is similar to a file, however, when you're using a file handle you can write to a specific file, whereas with a pool handle you can (though not necessarily supposed to) write to different objects. That is, a pool is more of a partition than a single file, so the analogy is not quite right.
The pool handle should only be used with objects that share the same context, but there's nothing in the infrastructure that prevents users to misuse it, and the penalty for using the wrong snap context can be very high (loss of data).

Yehuda
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#8 lore raw
In reply to Colin Patrick McCabe

Another idea: pool_t -> pool_context_t, PoolHandle -> PoolContext ?

C.

Quoted 15 lines · Colin Patrick McCabe
Quoted 8 lines · Sage Weil

We're definitely moving into bikeshedding territory now, but one thing Yehuda suggested:

The pool handle (rados_pool_t, PoolHandle) has state associated with it, including the snap to read from or snap context to write with.  That's not obvious from the name.  Maybe it should be renamed rados_ioctx_t to be more clear.  Then the pool we're reading to/writing from becomes one more piece of state associated with the handle.

PoolHandle in the C++ API and pool_t in the C API map onto RadosClient::PoolCtx, which contains the aforementioned state. So if we change this in the C++ API, we should change it all the way through, and rename pool_t, RadosClient::PoolCtx, etc.

Quoted 8 lines

Should we? I could go either way. The concept of a handle itself having properties is not really unfamiliar. After all, two different processes can open two different file descriptors referring to the same file, but one with O_RDONLY, and the other with O_WRONLY. etc. A handle to a thing is not the same as the thing itself.

Colin

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#9 lore raw
Quoted 1 line · Colin Patrick McCabe

Another idea: pool_t -> pool_context_t, PoolHandle -> PoolContext

I prefer rados_ioctx_t or rados_handle_t.. putting pool in the name is what is confusing (for me). Which pool you're using is just one (of potentially many) pieces of context/state associated with the handle.

sage

#10 lore raw
Quoted 7 lines · Sage Weil
Quoted 1 line · Colin Patrick McCabe

Another idea: pool_t -> pool_context_t, PoolHandle -> PoolContext

I prefer rados_ioctx_t or rados_handle_t.. putting pool in the name is what is confusing (for me).  Which pool you're using is just one (of potentially many) pieces of context/state associated with the handle.

Yeah. I'd also rename the rados_pool_open()/close() to something else, e.g., rados_open() and rados_close() or rados_x_open() and rados_x_close() where x is not pool.

Yehuda
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#11 lore raw

rados_ioctx_t seems to describe this object pretty well... I would lean away from rados_handle_t because it's too generic sounding and could be confused with the cluster_t.

C.

Quoted 9 lines · Yehuda Sadeh Weinraub
Quoted 7 lines · Sage Weil
Quoted 1 line · Colin Patrick McCabe

Another idea: pool_t -> pool_context_t, PoolHandle -> PoolContext

I prefer rados_ioctx_t or rados_handle_t.. putting pool in the name is what is confusing (for me).  Which pool you're using is just one (of potentially many) pieces of context/state associated with the handle.

Quoted 6 lines

Yeah. I'd also rename the rados_pool_open()/close() to something else, e.g., rados_open() and rados_close() or rados_x_open() and rados_x_close() where x is not pool.

Yehuda

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#12 lore raw
Quoted 3 lines · Colin Patrick McCabe

rados_ioctx_t seems to describe this object pretty well... I would lean away from rados_handle_t because it's too generic sounding and could be confused with the cluster_t.

Sounds good to me. And Rados::Ioctx I guess (IOCtx caps are too annoying IMO).

rados_ioctx_{open,close}?

sage

Quoted 27 lines

C.

Quoted 9 lines · Yehuda Sadeh Weinraub
Quoted 7 lines · Sage Weil
Quoted 1 line · Colin Patrick McCabe

Another idea: pool_t -> pool_context_t, PoolHandle -> PoolContext

I prefer rados_ioctx_t or rados_handle_t.. putting pool in the name is what is confusing (for me).  Which pool you're using is just one (of potentially many) pieces of context/state associated with the handle.

Quoted 6 lines

Yeah. I'd also rename the rados_pool_open()/close() to something else, e.g., rados_open() and rados_close() or rados_x_open() and rados_x_close() where x is not pool.

Yehuda

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html