Skip to contentSkip to conversation

cluster4 gfs_controld

Cluster-devel David Teigland 6 participants 12 messages Oct 13, 2011 – Oct 14, 2011

lore
Share & tools
lore
#0 lore raw

Here's the outline of my plan to remove/replace the essential bits of gfs_controld in cluster4. I expect it'll go away entirely, but there could be one or two minor things it would still handle on the side.

kernel dlm/gfs2 will continue to be operable with either . cluster3 dlm_controld/gfs_controld combination, or . cluster4 dlm_controld only

Two main things from gfs_controld need replacing:

1. jid allocation, first mounter

cluster3
. both from gfs_controld

cluster4
. jid from dlm-kernel "slots" which will be assigned similarly . first mounter using a dlm lock in lock_dlm

2. recovery coordination, failure notification

cluster3
. coordination of dlm-kernel/gfs-kernel recovery is done
indirectly in userspace between dlm_controld/gfs_controld, which then toggle sysfs files.
. write("sysfs block", 0) -> block_store(1)
write("sysfs recover", jid) -> recover_store(jid) write("sysfs block", 1) -> block_store(0)

cluster4
. coordination of dlm-kernel/gfs-kernel recovery is done
directly in kernel using callbacks from dlm-kernel to gfs-kernel.
. gdlm_mount(struct gfs2_sbd *sdp, const char *table, int *first, int *jid)
calls dlm_recover_register(dlm, &jid, &recover_callbacks)
. gdlm_recover_prep() -> block_store(1)
gdlm_recover_slot(jid) -> recover_store(jid) gdlm_recover_done() -> block_store(0)

cluster3 dlm/gfs recovery

. dlm_controld sees nodedown                      (libcpg)
. gfs_controld sees nodedown                      (libcpg)
. dlm_controld stops dlm-kernel                   (sysfs control 0)
. gfs_controld stops gfs-kernel                   (sysfs block 1)
. dlm_controld waits for gfs_controld kernel stop (libdlmcontrol)
. gfs_controld waits for dlm_controld kernel stop (libdlmcontrol)
. dlm_controld syncs state among all nodes        (libcpg)
. gfs_controld syncs state among all nodes        (libcpg)
. dlm_controld starts dlm-kernel recovery         (sysfs control 1)
. gfs_controld starts gfs-kernel recovery         (sysfs recover jid)
. gfs_controld starts gfs-kernel                  (sysfs block 0)

cluster4 dlm/gfs recovery

. dlm_controld sees nodedown                      (libcpg)
. dlm_controld stops dlm-kernel                   (sysfs control 0)
. dlm-kernel stops gfs-kernel                     (callback block 1)
. dlm_controld syncs state among all nodes        (libcpg)
. dlm_controld starts dlm-kernel recovery         (sysfs control 1)
. dlm-kernel starts gfs-kernel recovery           (callback recover jid)
. dlm-kernel starts gfs-kernel                    (callback block 0)
#1 lore raw

Hi,

Quoted 10 lines · David Teigland

Here's the outline of my plan to remove/replace the essential bits of gfs_controld in cluster4. I expect it'll go away entirely, but there could be one or two minor things it would still handle on the side.

kernel dlm/gfs2 will continue to be operable with either . cluster3 dlm_controld/gfs_controld combination, or . cluster4 dlm_controld only

Two main things from gfs_controld need replacing:

Quoted 7 lines

1. jid allocation, first mounter

cluster3
. both from gfs_controld

cluster4
. jid from dlm-kernel "slots" which will be assigned similarly

What is the actual algorithm used to assign these slots?

Quoted 2 lines

. first mounter using a dlm lock in lock_dlm

That sounds good to me. The thing we need to resolve is how do we get from one to the other. We may have to introduce a new name for the lock protocol to avoid people accidentally using both schemes in the same cluster.

Quoted 10 lines

2. recovery coordination, failure notification

cluster3
. coordination of dlm-kernel/gfs-kernel recovery is done
indirectly in userspace between dlm_controld/gfs_controld, which then toggle sysfs files.
. write("sysfs block", 0) -> block_store(1)
write("sysfs recover", jid) -> recover_store(jid) write("sysfs block", 1) -> block_store(0)

Quoted 5 lines

cluster4
. coordination of dlm-kernel/gfs-kernel recovery is done
directly in kernel using callbacks from dlm-kernel to gfs-kernel.
. gdlm_mount(struct gfs2_sbd *sdp, const char *table, int *first, int *jid)
calls dlm_recover_register(dlm, &jid, &recover_callbacks)

Can we not just pass the extra functions to dlm_create_lockspace? That seems a bit simpler than adding an extra function just to register the callbacks,

Steve.

Quoted 26 lines

. gdlm_recover_prep() -> block_store(1)
gdlm_recover_slot(jid) -> recover_store(jid)
gdlm_recover_done() -> block_store(0)

cluster3 dlm/gfs recovery

. dlm_controld sees nodedown                      (libcpg)
. gfs_controld sees nodedown                      (libcpg)
. dlm_controld stops dlm-kernel                   (sysfs control 0)
. gfs_controld stops gfs-kernel                   (sysfs block 1)
. dlm_controld waits for gfs_controld kernel stop (libdlmcontrol)
. gfs_controld waits for dlm_controld kernel stop (libdlmcontrol)
. dlm_controld syncs state among all nodes        (libcpg)
. gfs_controld syncs state among all nodes        (libcpg)
. dlm_controld starts dlm-kernel recovery         (sysfs control 1)
. gfs_controld starts gfs-kernel recovery         (sysfs recover jid)
. gfs_controld starts gfs-kernel                  (sysfs block 0)

cluster4 dlm/gfs recovery

. dlm_controld sees nodedown                      (libcpg)
. dlm_controld stops dlm-kernel                   (sysfs control 0)
. dlm-kernel stops gfs-kernel                     (callback block 1)
. dlm_controld syncs state among all nodes        (libcpg)
. dlm_controld starts dlm-kernel recovery         (sysfs control 1)
. dlm-kernel starts gfs-kernel recovery           (callback recover jid)
. dlm-kernel starts gfs-kernel                    (callback block 0)
#8 lore raw
In reply to David Teigland

Just a question.
I'm happy if you give me a hint.

Quoted 8 lines

...
cluster3 dlm/gfs recovery

. dlm_controld sees nodedown                      (libcpg)
. gfs_controld sees nodedown                      (libcpg)
. dlm_controld stops dlm-kernel                   (sysfs control 0)
. gfs_controld stops gfs-kernel                   (sysfs block 1)

. dlm_controld waits for gfs_controld kernel stop (libdlmcontrol)
...

"dlm_controld waits for gfs_controld kernel stop (libdlmcontrol)"

Is this true?
I'd like to know which source code file of which package this is written. Which should I inspect dlm_controld or libdlmcontrol?

(I'm working on wireshark to handle the combination between
dlm_controld.)

Masatake YAMATO

#2 lore raw
In reply to Steven Whitehouse
Quoted 3 lines · Steven Whitehouse
Quoted 2 lines

cluster4
. jid from dlm-kernel "slots" which will be assigned similarly

What is the actual algorithm used to assign these slots?

The same as picking jids: lowest unused id starting with 0. As for implementation, I'll add it to the current dlm recovery messages.

(Frankly, I'd really like to just set jid to nodeid-1. Any support for that? It would obviously add a slight requirement to picking nodeid's, which 99.9% of people already do.)

Quoted 6 lines
Quoted 2 lines

. first mounter using a dlm lock in lock_dlm

That sounds good to me. The thing we need to resolve is how do we get from one to the other. We may have to introduce a new name for the lock protocol to avoid people accidentally using both schemes in the same cluster.

Compatibility rests on the fact that the new dlm kernel features will only work when the cluster4 dlm_controld is used.

dlm_controld.v3 running: dlm_recover_register() returns an error, and everything falls back to working as it does now, with gfs_controld.v3 etc.

dlm_controld.v4 running: dlm_recover_register() works, lock_dlm sets jid and first. (gfs_controld.v3 will fail to even run with dlm_controld.v4, and other combinations of v3/v4 daemons will also fail to run together.)

Quoted 8 lines
Quoted 5 lines

cluster4
. coordination of dlm-kernel/gfs-kernel recovery is done
directly in kernel using callbacks from dlm-kernel to gfs-kernel.
. gdlm_mount(struct gfs2_sbd *sdp, const char *table, int *first, int *jid)
calls dlm_recover_register(dlm, &jid, &recover_callbacks)

Can we not just pass the extra functions to dlm_create_lockspace? That seems a bit simpler than adding an extra function just to register the callbacks,

Yes we could; I may do that. Returning the error mentioned above becomes less direct. I'd have to overload the jid arg, or add another to indicate the callbacks are enabled.

#9 lore raw
In reply to Masatake YAMATO
Quoted 12 lines · Masatake YAMATO

Just a question.
I'm happy if you give me a hint.

Quoted 8 lines

...
cluster3 dlm/gfs recovery

. dlm_controld sees nodedown                      (libcpg)
. gfs_controld sees nodedown                      (libcpg)
. dlm_controld stops dlm-kernel                   (sysfs control 0)
. gfs_controld stops gfs-kernel                   (sysfs block 1)

. dlm_controld waits for gfs_controld kernel stop (libdlmcontrol)
...

Quoted 5 lines

"dlm_controld waits for gfs_controld kernel stop (libdlmcontrol)"

Is this true?
I'd like to know which source code file of which package this is written. Which should I inspect dlm_controld or libdlmcontrol?

The function is check_fs_done()

http://git.fedorahosted.org/git?p=cluster.git;a=blob;f=group/dlm_controld/cpg.c;h=9b0d22333be540a733f2f74db4acc577c82b6026;hb=RHEL6#l636

#3 lore raw
In reply to David Teigland

Hi,

Quoted 8 lines · David Teigland
Quoted 3 lines · Steven Whitehouse
Quoted 2 lines

cluster4
. jid from dlm-kernel "slots" which will be assigned similarly

What is the actual algorithm used to assign these slots?

The same as picking jids: lowest unused id starting with 0. As for implementation, I'll add it to the current dlm recovery messages.

Yes, but the current implementation uses corosync to enforce ordering of events, so I'm wondering how the dlm will do that after the change.

Quoted 4 lines

(Frankly, I'd really like to just set jid to nodeid-1. Any support for that? It would obviously add a slight requirement to picking nodeid's, which 99.9% of people already do.)

The problem is that if you have a cluster with lots of nodes, but where each fs is only mounted by a small number of them, we'd have to insist on always creating as many journals as there are nodes in the cluster.

Quoted 22 lines
Quoted 6 lines
Quoted 2 lines

. first mounter using a dlm lock in lock_dlm

That sounds good to me. The thing we need to resolve is how do we get from one to the other. We may have to introduce a new name for the lock protocol to avoid people accidentally using both schemes in the same cluster.

Compatibility rests on the fact that the new dlm kernel features will only work when the cluster4 dlm_controld is used.

dlm_controld.v3 running: dlm_recover_register() returns an error, and everything falls back to working as it does now, with gfs_controld.v3 etc.

dlm_controld.v4 running: dlm_recover_register() works, lock_dlm sets jid and first. (gfs_controld.v3 will fail to even run with dlm_controld.v4, and other combinations of v3/v4 daemons will also fail to run together.)

Quoted 5 lines
Quoted 5 lines

cluster4
. coordination of dlm-kernel/gfs-kernel recovery is done
directly in kernel using callbacks from dlm-kernel to gfs-kernel.
. gdlm_mount(struct gfs2_sbd *sdp, const char *table, int *first, int *jid)
calls dlm_recover_register(dlm, &jid, &recover_callbacks)

Quoted 8 lines
Quoted 3 lines

Can we not just pass the extra functions to dlm_create_lockspace? That seems a bit simpler than adding an extra function just to register the callbacks,

Yes we could; I may do that. Returning the error mentioned above becomes less direct. I'd have to overload the jid arg, or add another to indicate the callbacks are enabled.

Another alternative is just to add a member of the recover_callbacks structure which would be a function taking the first and jid as arguments and the dlm can call that to pass the into to gfs2.

That way dlm users who don't care about that would just leave those functions NULL, for example,

Steve.

#11 lore raw
In reply to Masatake YAMATO

Hi,

Quoted 14 lines · Masatake YAMATO

Just a question.
I'm happy if you give me a hint.

Quoted 8 lines

...
cluster3 dlm/gfs recovery

. dlm_controld sees nodedown                      (libcpg)
. gfs_controld sees nodedown                      (libcpg)
. dlm_controld stops dlm-kernel                   (sysfs control 0)
. gfs_controld stops gfs-kernel                   (sysfs block 1)

. dlm_controld waits for gfs_controld kernel stop (libdlmcontrol)
...

"dlm_controld waits for gfs_controld kernel stop (libdlmcontrol)"

Quoted 9 lines

Is this true?
I'd like to know which source code file of which package this is written. Which should I inspect dlm_controld or libdlmcontrol?

(I'm working on wireshark to handle the combination between
dlm_controld.)

Masatake YAMATO

The communication between gfs_controld and dlm_controld is done via a unix socket, so you won't see that "on the wire",

Steve.

#4 lore raw
In reply to Steven Whitehouse
Quoted 6 lines · Steven Whitehouse

Hi,

Quoted 3 lines · David Teigland
Quoted 2 lines · Steven Whitehouse
Quoted 2 lines

cluster4
. jid from dlm-kernel "slots" which will be assigned similarly

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

What is the actual algorithm used to assign these slots?

The same as picking jids: lowest unused id starting with 0. As for implementation, I'll add it to the current dlm recovery messages.

Yes, but the current implementation uses corosync to enforce ordering of events, so I'm wondering how the dlm will do that after the change.

One node picks it and then tells everyone. In this case the low nodeid coordinating recovery, and the new data is added to the status messages. We still rely on agreed ordering of different recovery events, which is still based on libcpg.

In cluster3 everyone picks the same values independently based on the ordered events/messages, just because that's how gfs_controld decides everything.

Quoted 7 lines
Quoted 4 lines

(Frankly, I'd really like to just set jid to nodeid-1. Any support for that? It would obviously add a slight requirement to picking nodeid's, which 99.9% of people already do.)

The problem is that if you have a cluster with lots of nodes, but where each fs is only mounted by a small number of them, we'd have to insist on always creating as many journals as there are nodes in the cluster.

yeah

Quoted 10 lines
Quoted 4 lines

Yes we could; I may do that. Returning the error mentioned above becomes less direct. I'd have to overload the jid arg, or add another to indicate the callbacks are enabled.

Another alternative is just to add a member of the recover_callbacks structure which would be a function taking the first and jid as arguments and the dlm can call that to pass the into to gfs2.

That way dlm users who don't care about that would just leave those functions NULL, for example,

The simplest variation should become evident once I start writing it; it's hard to predict.

#10 lore raw
In reply to David Teigland

Thank you very much.

Masatake YAMATO

Quoted 23 lines · Masatake YAMATO
Quoted 12 lines

Just a question.
I'm happy if you give me a hint.

Quoted 8 lines

...
cluster3 dlm/gfs recovery

. dlm_controld sees nodedown                      (libcpg)
. gfs_controld sees nodedown                      (libcpg)
. dlm_controld stops dlm-kernel                   (sysfs control 0)
. gfs_controld stops gfs-kernel                   (sysfs block 1)

. dlm_controld waits for gfs_controld kernel stop (libdlmcontrol)
...

Quoted 5 lines

"dlm_controld waits for gfs_controld kernel stop (libdlmcontrol)"

Is this true?
I'd like to know which source code file of which package this is written. Which should I inspect dlm_controld or libdlmcontrol?

The function is check_fs_done()

http://git.fedorahosted.org/git?p=cluster.git;a=blob;f=group/dlm_controld/cpg.c;h=9b0d22333be540a733f2f74db4acc577c82b6026;hb=RHEL6#l636

#5 lore raw
In reply to David Teigland
Quoted 11 lines · David Teigland
Quoted 3 lines · Steven Whitehouse
Quoted 2 lines

cluster4
. jid from dlm-kernel "slots" which will be assigned similarly

What is the actual algorithm used to assign these slots?

The same as picking jids: lowest unused id starting with 0. As for implementation, I'll add it to the current dlm recovery messages.

(Frankly, I'd really like to just set jid to nodeid-1. Any support for that? It would obviously add a slight requirement to picking nodeid's, which 99.9% of people already do.)

While I think this is simple, I don't think this is the best idea.

This would only work efficiently if the cluster stack only used whole numbers, instead of say "integer" (like native corosync).

-- Lon

#6 lore raw
Quoted 9 lines · Lon Hohberger
Quoted 8 lines · David Teigland
Quoted 3 lines · Steven Whitehouse
Quoted 2 lines

cluster4
. jid from dlm-kernel "slots" which will be assigned similarly

What is the actual algorithm used to assign these slots?

The same as picking jids: lowest unused id starting with 0. As for implementation, I'll add it to the current dlm recovery messages.

Quoted 8 lines
Quoted 3 lines

(Frankly, I'd really like to just set jid to nodeid-1. Any support for that? It would obviously add a slight requirement to picking nodeid's, which 99.9% of people already do.)

While I think this is simple, I don't think this is the best idea.

This would only work efficiently if the cluster stack only used whole numbers, instead of say "integer" (like native corosync).

Doesn't pacemaker assigns random nodes ID in the 2^31 range? IIRC there was a long debate at some point in the area. I am sure Andrew can shed some light here.

Fabio

#7 lore raw
Quoted 16 lines · Fabio M. Di Nitto
Quoted 15 lines · Lon Hohberger
Quoted 11 lines · David Teigland
Quoted 3 lines · Steven Whitehouse
Quoted 2 lines

cluster4
. jid from dlm-kernel "slots" which will be assigned similarly

What is the actual algorithm used to assign these slots?

The same as picking jids: lowest unused id starting with 0. ?As for implementation, I'll add it to the current dlm recovery messages.

(Frankly, I'd really like to just set jid to nodeid-1. ?Any support for that? ?It would obviously add a slight requirement to picking nodeid's, which 99.9% of people already do.)

While I think this is simple, I don't think this is the best idea.

Quoted 7 lines
Quoted 2 lines

This would only work efficiently if the cluster stack only used whole numbers, instead of say "integer" (like native corosync).

Doesn't pacemaker assigns random nodes ID in the 2^31 range? IIRC there was a long debate at some point in the area. I am sure Andrew can shed some light here.

Pacemaker doesn't assign node IDs.
But the people that configure corosync for use with Pacemaker often leave nodeid unset and get the default (a semi-random 2^31 integer)