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

NAS-127511 / 24.10 / Retrieve path properly when spare is INUSE #276

Closed
wants to merge 1 commit into from

Conversation

Qubad786
Copy link
Contributor

@Qubad786 Qubad786 commented Aug 11, 2024

Problem

When we had a disk replaced by spare in a pool i.e

config:

	NAME                                        STATE     READ WRITE CKSUM
	testspare                                   ONLINE       0     0     0
	  mirror-0                                  ONLINE       0     0     0
	    spare-0                                 ONLINE       0     0     0
	      9d92cdac-f627-446c-8ace-169b6dec27a0  ONLINE       0     0     0
	      f7c8e925-6ede-4331-8fd3-ee70570772e0  ONLINE       0     0     0
	    1eb6a232-9a25-4867-80bb-ffd1b0797891    ONLINE       0     0     0
	  mirror-1                                  ONLINE       0     0     0
	    474f99c6-a0d4-491f-8440-9c5761018b4d    ONLINE       0     0     0
	    dca2f116-a998-4b2d-92d5-4389837cc8c8    ONLINE       0     0     0
	special
	  58d6865e-664f-456c-a6bb-391e53e014d8      ONLINE       0     0     0
	logs
	  790817f9-9e27-4576-8b99-093b8d792962      ONLINE       0     0     0
	cache
	  a6f48d2e-256c-4eba-a451-e4b6bb147eee      ONLINE       0     0     0
	spares
	  f7c8e925-6ede-4331-8fd3-ee70570772e0      INUSE     currently in use
	  4d982589-03a3-4ae3-934a-8386a49a891c      AVAIL
	  4a5ab019-d9b4-4ebe-ae54-c5d73911b4fc      AVAIL
	  46f25d7f-9759-49fd-99b2-7210bfb5602b      AVAIL
	  34ecb450-8aea-4e04-92d8-71845bc4e21b      AVAIL

errors: No known data errors

We were not showing the path for spare properly when retrieving information via zfs.pool.get_instance i.e

      {
        "name": "mirror-0",
        "type": "mirror",
        "path": null,
        "guid": "5026909711149930182",
        "status": "ONLINE",
        "stats": {
          "timestamp": 106300558268,
          "read_errors": 0,
          "write_errors": 0,
          "checksum_errors": 0,
          "ops": [
            0,
            13,
            177,
            0,
            0,
            0,
            0
          ],
          "bytes": [
            0,
            532480,
            8527872,
            0,
            0,
            0,
            0
          ],
          "size": 20937965568,
          "allocated": 0,
          "fragmentation": 0,
          "self_healed": 0,
          "configured_ashift": 12,
          "logical_ashift": 12,
          "physical_ashift": 9
        },
        "children": [
          {
            "name": "spare-0",
            "type": "spare",
            "path": null,
            "guid": "6196847144877069196",
            "status": "ONLINE",

Solution

Make sure we properly report the spare path which is actually being consumed when we retrieve information for a pool which has spares being used.

  "groups": {
    "data": [
      {
        "name": "mirror-0",
        "type": "mirror",
        "path": null,
        "guid": "5026909711149930182",
        "status": "ONLINE",
        "stats": {
          "timestamp": 1793844765986,
          "read_errors": 0,
          "write_errors": 0,
          "checksum_errors": 0,
          "ops": [
            0,
            13,
            177,
            0,
            0,
            0,
            0
          ],
          "bytes": [
            0,
            532480,
            8527872,
            0,
            0,
            0,
            0
          ],
          "size": 20937965568,
          "allocated": 0,
          "fragmentation": 0,
          "self_healed": 0,
          "configured_ashift": 12,
          "logical_ashift": 12,
          "physical_ashift": 9
        },
        "children": [
          {
            "name": "spare-0",
            "type": "spare",
            "path": "/dev/disk/by-partuuid/f7c8e925-6ede-4331-8fd3-ee70570772e0",
            "guid": "6196847144877069196",
            "status": "ONLINE",
            "stats": {

@Qubad786 Qubad786 requested a review from a team August 11, 2024 06:34
@bugclerk bugclerk changed the title Retrieve path properly when spare is INUSE NAS-127511 / 24.10 / Retrieve path properly when spare is INUSE Aug 11, 2024
@bugclerk
Copy link

@Qubad786 Qubad786 closed this Sep 18, 2024
@Qubad786 Qubad786 deleted the NAS-127511 branch September 18, 2024 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants