Skip to content
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

Shared L2ARC - Proof of Concept #14060

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions cmd/zpool/zpool_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2437,6 +2437,10 @@ print_status_config(zpool_handle_t *zhp, status_cbdata_t *cb, const char *name,
(void) printf(gettext("invalid label"));
break;

case VDEV_AUX_POOL_USES_NTNX_SHARED_L2ARC:
(void) printf(gettext("ignored in favor of cache devices in pool " NTNX_L2ARC_POOL_NAME));
break;

default:
(void) printf(gettext("corrupted data"));
break;
Expand Down Expand Up @@ -2596,6 +2600,10 @@ print_import_config(status_cbdata_t *cb, const char *name, nvlist_t *nv,
(void) printf(gettext("invalid label"));
break;

case VDEV_AUX_POOL_USES_NTNX_SHARED_L2ARC:
(void) printf(gettext("ignored in favor of cache devices in pool " NTNX_L2ARC_POOL_NAME));
break;

default:
(void) printf(gettext("corrupted data"));
break;
Expand Down Expand Up @@ -2896,6 +2904,11 @@ show_import(nvlist_t *config, boolean_t report_error)
"\tExpect reduced performance.\n"));
break;

case ZPOOL_STATUS_USES_NTNX_SHARED_L2ARC:
(void) printf_color(ANSI_BOLD,
gettext(" status: The pool has L2ARC devices that will be ignored in favor of the shared L2ARC devices in pool " NTNX_L2ARC_POOL_NAME ".\n"));
break;

default:
/*
* No other status can be seen when importing pools.
Expand Down Expand Up @@ -3035,6 +3048,9 @@ show_import(nvlist_t *config, boolean_t report_error)
(void) printf(gettext(" action: Set a unique system "
"hostid with the zgenhostid(8) command.\n"));
break;
case ZPOOL_STATUS_USES_NTNX_SHARED_L2ARC:
(void) printf(gettext(" action: The pool's L2ARC devices will be ignored in favor of the shared L2ARC devices in pool " NTNX_L2ARC_POOL_NAME ".\n"));
break;
default:
(void) printf(gettext(" action: The pool cannot be "
"imported due to damaged devices or data.\n"));
Expand Down Expand Up @@ -8523,6 +8539,10 @@ status_callback(zpool_handle_t *zhp, void *data)
}
break;

case ZPOOL_STATUS_USES_NTNX_SHARED_L2ARC:
(void) printf(gettext("status: The pool has L2ARC devices that will be ignored in favor of the shared L2ARC devices in pool " NTNX_L2ARC_POOL_NAME ".\n"));
break;

default:
/*
* The remaining errors can't actually be generated, yet.
Expand Down
5 changes: 5 additions & 0 deletions include/libzfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,11 @@ typedef enum {
ZPOOL_STATUS_NON_NATIVE_ASHIFT, /* (e.g. 512e dev with ashift of 9) */
ZPOOL_STATUS_COMPATIBILITY_ERR, /* bad 'compatibility' property */
ZPOOL_STATUS_INCOMPATIBLE_FEAT, /* feature set outside compatibility */
/*
* Pool won't use the given L2ARC because this software version uses
* the Nutanix shared L2ARC.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeet branding:

Suggested change
* the Nutanix shared L2ARC.
* the shared L2ARC.

*/
ZPOOL_STATUS_USES_NTNX_SHARED_L2ARC,

/*
* Finally, the following indicates a healthy pool.
Expand Down
1 change: 1 addition & 0 deletions include/sys/arc.h
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ void arc_fini(void);
* Level 2 ARC
*/

#define NTNX_L2ARC_POOL_NAME "NTNX-fsvm-local-l2arc"
void l2arc_add_vdev(spa_t *spa, vdev_t *vd);
void l2arc_remove_vdev(vdev_t *vd);
boolean_t l2arc_vdev_present(vdev_t *vd);
Expand Down
2 changes: 2 additions & 0 deletions include/sys/fs/zfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -956,6 +956,7 @@ typedef enum vdev_state {
VDEV_STATE_REMOVED, /* Explicitly removed from system */
VDEV_STATE_CANT_OPEN, /* Tried to open, but failed */
VDEV_STATE_FAULTED, /* External request to fault device */
VDEV_STATE_UNUSED,
VDEV_STATE_DEGRADED, /* Replicated vdev with unhealthy kids */
VDEV_STATE_HEALTHY /* Presumed good */
} vdev_state_t;
Expand Down Expand Up @@ -985,6 +986,7 @@ typedef enum vdev_aux {
VDEV_AUX_SPLIT_POOL, /* vdev was split off into another pool */
VDEV_AUX_BAD_ASHIFT, /* vdev ashift is invalid */
VDEV_AUX_EXTERNAL_PERSIST, /* persistent forced fault */
VDEV_AUX_POOL_USES_NTNX_SHARED_L2ARC,
VDEV_AUX_ACTIVE, /* vdev active on a different host */
VDEV_AUX_CHILDREN_OFFLINE, /* all children are offline */
VDEV_AUX_ASHIFT_TOO_BIG, /* vdev's min block size is too large */
Expand Down
2 changes: 2 additions & 0 deletions lib/libzfs/libzfs_pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ zpool_state_to_name(vdev_state_t state, vdev_aux_t aux)
return (gettext("DEGRADED"));
case VDEV_STATE_HEALTHY:
return (gettext("ONLINE"));
case VDEV_STATE_UNUSED:
return (gettext("UNUSED"));

default:
break;
Expand Down
Loading