-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pool/volume create/import/destroy for uzfs #43
pool/volume create/import/destroy for uzfs #43
Conversation
Signed-off-by: Vishnu Itta <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice changes! thanks Vitta
@@ -654,14 +654,17 @@ open_pool(spa_t **spa) | |||
} | |||
|
|||
void | |||
open_ds(spa_t *spa, zvol_state_t **zv) | |||
open_ds(spa_t *spa, char *ds, zvol_state_t **zv) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is a mystery to me that the previous code was compilable without ds being declared as local var or passed as parameter. Could you explain?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there seems to be a global variable with same name.. :)
cmd/uzfs_test/uzfs_test.c
Outdated
int err; | ||
err = uzfs_open_dataset(spa, ds, zv); | ||
if (err != 0) { | ||
printf("ds open errored.. %d\n", err); | ||
exit(1); | ||
} | ||
(void) snprintf(name, sizeof (name), "%s/%s", spa_name(spa), ds); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see name[] used anywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true.. will remove it
} | ||
|
||
/* | ||
* Send command to read data and read reply header. Reading payload is | ||
* left to the caller. | ||
*/ | ||
void read_data_start(size_t offset, int len, zvol_io_hdr_t *hdr_inp) | ||
void read_data_start(int m_data_fd, int &m_ioseq, size_t offset, int len, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just if we can rename m_data_fd -> data_fd and m_ioseq -> ioseq (and the same change for write_data_start, write_data_and_verify_resp, write_two_chunks_and_verify_resp, read_data_and_verify_resp). The reason is that the "m_" prefix implies a class member variable, while in this case it is ordinary method parameter.
Thinking more about it. Let's move these methods completely out of the class and make functions from them. There was a value to have them as methods when they were accessing class member fields m_data_fd and m_io_seq, but since now we pass all context information to them through parameters, there is not a good reason why these methods should not be converted to utility functions outside of the class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure.. will remove "m_" prefix.. will also check if these can be moved out of class
|
||
do_handshake(m_zvol_name1, m_host1, m_port1, m_control_fd1, | ||
ZVOL_OP_STATUS_OK); | ||
m_zrepl->kill(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering why do we restart zrepl in setup hook. The purpose of this function is to set up test environment and not to test anything here. Besides that, we already have a test case for creating a zvol before and after restart if I remember correctly. So I would prefer the simplest code here, which is to create both zvols at once without restart.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
other test case where zrepl is killed won't send IOs @jkryl .. I noticed a code issue while fixing some other issue and checked why this code was not catching it. Hence, added this test case.
} | ||
// } catch (std::runtime_error re) { | ||
// ; | ||
// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this is a good idea. But let's try it :-) In theory this command should never fail, but we know that even zpool destroy sometimes fails with EBUSY.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this being test code, idea is - lets see if this errors out and fix the reason for it
cmd/zrepl/mgmt_conn.c
Outdated
fprintf(stderr, "Unknown zvol: %s\n", zvol_name); | ||
if (((zinfo = uzfs_zinfo_lookup(zvol_name)) == NULL) || | ||
(zinfo->mgmt_conn != conn)) { | ||
ZREPL_ERRLOG("Unknown zvol: %s\n", zvol_name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's avoid using ZREPL_ERRLOG in mgmt_conn.c file. syslog logging is going to be removed from zrepl in the future and I already cleaned mgmt_conn.c file from them. All messages here should be either error messages to stderr or debug messages using DBGCONN (which end up on stderr as well). This particular message should be fprintf(stderr, ...) since it is not a debug message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok.. I will change it.. one reason I changed this is - I'm not seeing the logs coming to /var/log/syslog.. where will these logs goes?
* Try to obtain controller address from zfs property. | ||
*/ | ||
static int | ||
get_controller_ip(objset_t *os, char *buf, int len) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember I had to pull a few zfs header files because of this function to mgmt_conn.c. Most likely dmu* and dsl* header files are not needed anymore. Would be good if we can clean them up from this file as part of this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense.. will do that
printf("zrepl command args ... \nwhere 'command' is one of:\n\n"); | ||
printf("\t import <pool_name> [-t ip address)]\n"); | ||
printf("\t start [-t ip address)]\n"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now when we removed start and import subcommands and zrepl starts without any parameters, I have a question what is the expected way of importing a pool holding replicas by sidecar. Is it:
cmd/zrepl/zrepl
# after zrepl is up and running (probably execute in loop with sleep 1):
cmd/zpool/zpool import <name>
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes @jkryl
@@ -22,6 +22,8 @@ before_install: | |||
# packages for tests | |||
- sudo apt-get install --yes -qq parted lsscsi ksh attr acl nfs-kernel-server fio | |||
- sudo apt-get install --yes -qq libgtest-dev cmake | |||
# packages for debugging | |||
- sudo apt-get install gdb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, I assume that this is to help us debug problems using gdb on travis directly, correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right @jkryl .. after this, idea is to have a script that loads and prints stacktrace of a coredump
updated the review comments @jkryl .. let me know if this looks good |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me sir.
* pool/volume create/import/destroy/export for uzfs * testcase to do IOs on imported pools * CLI tests for target IP address * owning dataset in uZFS during handshake with target Signed-off-by: Vishnu Itta <[email protected]>
In uZFS, pool and volume creation/destroy and import paths are not complete and patchy.
Below are changes:
Along with stabilization of current testcases and travis, added:
Without target IP option for 'zfs create' command, volume will be created, but, uZFS and ZINFO related data structures won't be created.