Code Monkey home page Code Monkey logo

Comments (4)

derekbit avatar derekbit commented on May 28, 2024 2

I suspect something related to this: https://github.com/longhorn/longhorn-spdk-engine/blob/a6cee5b6febac0a58b5ba2f4b9b5a4d06d9343b2/pkg/spdk/disk.go#L172

return fmt.Sprintf("%d-%d", dev.Export.Major, dev.Export.Minor), nil

While, the spdk helper will feed dev.Nvme instead of dev.Export: https://github.com/longhorn/go-spdk-helper/blob/ab0344a0c192095de0130f6c5121105be1ab6b33/pkg/util/device.go#L124

if _, err := fmt.Sscanf(f[1], "%d:%d", &dev.Nvme.Major, &dev.Nvme.Minor); err != nil {

The final user of this: https://github.com/longhorn/longhorn-spdk-engine/blob/a6cee5b6febac0a58b5ba2f4b9b5a4d06d9343b2/pkg/spdk/disk.go#L222

		if id == diskID {
			return fmt.Errorf("disk %v is already used by AIO bdev %v", diskPath, bdev.Name)
		}

Maybe I miss something that would make sure that dev.Export contain the same thing than dev.Nvme. If not, that may explain the issue ?

Thanks @arsiesys
Yes, checked the codes. The bug is caused by the reason you said. Thank you.

from longhorn.

arsiesys avatar arsiesys commented on May 28, 2024 1

I suspect something related to this:
https://github.com/longhorn/longhorn-spdk-engine/blob/a6cee5b6febac0a58b5ba2f4b9b5a4d06d9343b2/pkg/spdk/disk.go#L172

return fmt.Sprintf("%d-%d", dev.Export.Major, dev.Export.Minor), nil

While, the spdk helper will feed dev.Nvme instead of dev.Export:
https://github.com/longhorn/go-spdk-helper/blob/ab0344a0c192095de0130f6c5121105be1ab6b33/pkg/util/device.go#L124

if _, err := fmt.Sscanf(f[1], "%d:%d", &dev.Nvme.Major, &dev.Nvme.Minor); err != nil {

The final user of this:
https://github.com/longhorn/longhorn-spdk-engine/blob/a6cee5b6febac0a58b5ba2f4b9b5a4d06d9343b2/pkg/spdk/disk.go#L222

		if id == diskID {
			return fmt.Errorf("disk %v is already used by AIO bdev %v", diskPath, bdev.Name)
		}

Maybe I miss something that would make sure that dev.Export contain the same thing than dev.Nvme. If not, that may explain the issue ?

from longhorn.

longhorn-io-github-bot avatar longhorn-io-github-bot commented on May 28, 2024

Pre Ready-For-Testing Checklist

  • Where is the reproduce steps/test steps documented?
    The reproduce steps/test steps are at:
  1. Enable v2-data-engine
  2. Create two block devices such as loop devices
  3. Add the two disks to block-type disks
  4. One of the two disks shows the error message ... is already used by AIO bdev ... in node.status.diskStatus

After the fix, the two disks can be added successfully.

  • Does the PR include the explanation for the fix or the feature?

  • Have the backend code been merged (Manager, Engine, Instance Manager, BackupStore etc) (including backport-needed/*)?
    The PR is at

longhorn/longhorn-spdk-engine#121

  • Which areas/issues this PR might have potential impacts on?
    Area: v2 volume
    Issues

from longhorn.

chriscchien avatar chriscchien commented on May 28, 2024

Verified pass on longhorn master (longhorn-instance-manager dce3a1) with test steps

Can add two block devices as block-type disks on the same longhorn node without problem

    disk-2:
      conditions:
      - lastProbeTime: ""
        lastTransitionTime: "2024-03-12T02:28:38Z"
        message: Disk disk-2(/dev/loop5) on node ip-172-31-38-210 is ready
        reason: ""
        status: "True"
        type: Ready
      - lastProbeTime: ""
        lastTransitionTime: "2024-03-12T02:28:38Z"
        message: Disk disk-2(/dev/loop5) on node ip-172-31-38-210 is schedulable
        reason: ""
        status: "True"
        type: Schedulable
      diskType: block
      diskUUID: 37c78eb0-1a15-4fc2-9898-81a672e6039c
      filesystemType: ""
      scheduledReplica: {}
      storageAvailable: 10590617600
      storageMaximum: 10694426624
      storageScheduled: 0
    disk-3:
      conditions:
      - lastProbeTime: ""
        lastTransitionTime: "2024-03-12T02:29:08Z"
        message: Disk disk-3(/dev/loop6) on node ip-172-31-38-210 is ready
        reason: ""
        status: "True"
        type: Ready
      - lastProbeTime: ""
        lastTransitionTime: "2024-03-12T02:29:08Z"
        message: Disk disk-3(/dev/loop6) on node ip-172-31-38-210 is schedulable
        reason: ""
        status: "True"
        type: Schedulable
      diskType: block
      diskUUID: 3924c40a-4377-49c1-9730-571c1f35809a
      filesystemType: ""
      scheduledReplica: {}
      storageAvailable: 10590617600
      storageMaximum: 10694426624
      storageScheduled: 0

from longhorn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.