Skip to content

docs: document volume size design#2

Open
pohly wants to merge 4 commits into
okartau:creation-size-fixesfrom
pohly:volume-size
Open

docs: document volume size design#2
pohly wants to merge 4 commits into
okartau:creation-size-fixesfrom
pohly:volume-size

Conversation

@pohly

@pohly pohly commented Jun 14, 2021

Copy link
Copy Markdown

This is the outcome of the discussion in
intel#933 (comment)

okartau added 3 commits June 11, 2021 10:40
We need newer-than-v67 of ndctl but buster has v63, so we install
ndctl from buster-backports.
Added interface to get Region Alignment value.
Align creation size down also to closest Region alignment boundary.
Creation size may get adjusted so moving check for available
space to happen after that.
Alignment adjust happens in this function and not in callers
any more, and aligning happens down.
Use trial-based value 66 per 4096 for size compensating,
which needs to be in scale with request size
(earlier was: constant value which failed to scale up).
Use 2M alignment instead of 1G.
Device-manager layer does not adjust by alignment any more,
it will happen in lower function (in region.go)
same way for both device managers.
This is the outcome of the discussion in
intel#933 (comment)
@okartau okartau force-pushed the creation-size-fixes branch 4 times, most recently from bc503b2 to 7ae5a42 Compare June 16, 2021 10:29
okartau pushed a commit that referenced this pull request Sep 14, 2021
The previous approach tried to reduce the output of the underlying
commands. For direct mode, that involved sorting by keyword, which
made error messages almost impossible to read ("not meant to be
pretty-printed for human"). The problem is that these error
messages *do* get read by humans when a volume leaks.

The new approach simply splits output into lines with a prefix that
gives enough context (host + mode) for the volume and then uses
stretchr/testify/assert to print a diff. That's the part that then is
human-readable, with full list of lines provided as additional
context. Examples below.

In addition, the master node also gets checked. This is important
because some tests now run there (raw namespace conversion).

Also, LVM and direct mode both get checked for more tests. We can no
longer assume that a test only touches volumes of one kind because the
driver has become more flexible than that and even before might have
had bugs that caused other changes.

• Failure in Spec Teardown (AfterEach) [5.560 seconds]
lvm-testing
/nvme/gopath/src/github.com/intel/pmem-csi/test/e2e/deploy/deploy.go:1304
  sanity [AfterEach]
  /nvme/gopath/src/github.com/intel/pmem-csi/test/e2e/deploy/deploy.go:1289
    Node Service
    /nvme/gopath/pkg/mod/github.com/kubernetes-csi/csi-test/v3@v3.1.1/pkg/sanity/tests.go:44
      should work
      /nvme/gopath/pkg/mod/github.com/kubernetes-csi/csi-test/v3@v3.1.1/pkg/sanity/node.go:779

      	Error Trace:	volumeleaks.go:78
      	            				deploy.go:990
      	            				runner.go:113
      	            				runner.go:64
      	            				setup_nodes.go:15
      	            				spec.go:180
      	            				spec.go:218
      	            				spec.go:138
      	            				spec_runner.go:200
      	            				spec_runner.go:170
      	            				spec_runner.go:66
      	            				suite.go:79
      	            				ginkgo_dsl.go:229
      	            				ginkgo_dsl.go:217
      	            				e2e.go:169
      	            				e2e_test.go:71
      	Error:      	Not equal:
      	            	expected: deploy.Volumes{"host #0, LVM: ", "host #0, direct: ", "host #1, LVM: sanity-09f3bdaa1cf7ba19a84b3d98f13566f15b5f7fa243af965cc3f3f72c ndbus0region0fsdax -wi-a----- 4.00m", "host #1, LVM: sanity-4c41bdae3a73008815097201e98b73cd93c7651d2f500c056a841a9b ndbus0region0fsdax -wi-a----- 4.00m", "host #1, LVM: sanity-6db7a339756c86301de2b2017abf4cc2ca66a1d52982f66e7ac0299d ndbus0region0fsdax -wi-a----- 4.00m", "host #1, LVM: ", "host #1, direct: mode:fsdax,size:32212254720,uuid:6c79e657-9b9d-11eb-a703-0e16888583db,", "host #2, LVM: ", "host #2, direct: mode:fsdax,size:32212254720,uuid:6bfc18d7-9b9d-11eb-bd85-7e089b645596,", "host intel#3, LVM: ", "host intel#3, direct: mode:fsdax,size:32212254720,uuid:6c007833-9b9d-11eb-9e8f-4e1e819e52d7,"}
      	            	actual  : deploy.Volumes{"host #0, LVM: ", "host #0, direct: ", "host #1, LVM: sanity-09f3bdaa1cf7ba19a84b3d98f13566f15b5f7fa243af965cc3f3f72c ndbus0region0fsdax -wi-a----- 4.00m", "host #1, LVM: sanity-4c41bdae3a73008815097201e98b73cd93c7651d2f500c056a841a9b ndbus0region0fsdax -wi-a----- 4.00m", "host #1, LVM: sanity-6db7a339756c86301de2b2017abf4cc2ca66a1d52982f66e7ac0299d ndbus0region0fsdax -wi-a----- 4.00m", "host #1, LVM: sanity-fcd36a1f738ddb2a778fc0c2db31a15d03734daf8967525aa6698efd ndbus0region0fsdax -wi-a----- 4.00m", "host #1, LVM: ", "host #1, direct: mode:fsdax,size:32212254720,uuid:6c79e657-9b9d-11eb-a703-0e16888583db,", "host #2, LVM: ", "host #2, direct: mode:fsdax,size:32212254720,uuid:6bfc18d7-9b9d-11eb-bd85-7e089b645596,", "host intel#3, LVM: ", "host intel#3, direct: mode:fsdax,size:32212254720,uuid:6c007833-9b9d-11eb-9e8f-4e1e819e52d7,"}

      	            	Diff:
      	            	--- Expected
      	            	+++ Actual
      	            	@@ -1,2 +1,2 @@
      	            	-(deploy.Volumes) (len=11) {
      	            	+(deploy.Volumes) (len=12) {
      	            	  (string) (len=14) "host #0, LVM: ",
      	            	@@ -6,2 +6,3 @@
      	            	  (string) (len=113) "host #1, LVM: sanity-6db7a339756c86301de2b2017abf4cc2ca66a1d52982f66e7ac0299d ndbus0region0fsdax -wi-a----- 4.00m",
      	            	+ (string) (len=113) "host #1, LVM: sanity-fcd36a1f738ddb2a778fc0c2db31a15d03734daf8967525aa6698efd ndbus0region0fsdax -wi-a----- 4.00m",
      	            	  (string) (len=14) "host #1, LVM: ",
      	Test:       	lvm-testing sanity Node Service should work

      /nvme/gopath/src/github.com/intel/pmem-csi/test/e2e/deploy/volumeleaks.go:78

• Failure in Spec Teardown (AfterEach) [5.575 seconds]
direct-testing
/nvme/gopath/src/github.com/intel/pmem-csi/test/e2e/deploy/deploy.go:1304
  sanity [AfterEach]
  /nvme/gopath/src/github.com/intel/pmem-csi/test/e2e/deploy/deploy.go:1289
    Node Service
    /nvme/gopath/pkg/mod/github.com/kubernetes-csi/csi-test/v3@v3.1.1/pkg/sanity/tests.go:44
      should work
      /nvme/gopath/pkg/mod/github.com/kubernetes-csi/csi-test/v3@v3.1.1/pkg/sanity/node.go:779

      	Error Trace:	volumeleaks.go:74
      	            				deploy.go:990
      	            				runner.go:113
      	            				runner.go:64
      	            				setup_nodes.go:15
      	            				spec.go:180
      	            				spec.go:218
      	            				spec.go:138
      	            				spec_runner.go:200
      	            				spec_runner.go:170
      	            				spec_runner.go:66
      	            				suite.go:79
      	            				ginkgo_dsl.go:229
      	            				ginkgo_dsl.go:217
      	            				e2e.go:169
      	            				e2e_test.go:71
      	Error:      	Not equal:
      	            	expected: deploy.Volumes{"host #0, LVM: ", "host #0, direct: ", "host #1, LVM: sanity-09f3bdaa1cf7ba19a84b3d98f13566f15b5f7fa243af965cc3f3f72c ndbus0region0fsdax -wi-a----- 4.00m", "host #1, LVM: sanity-4c41bdae3a73008815097201e98b73cd93c7651d2f500c056a841a9b ndbus0region0fsdax -wi-a----- 4.00m", "host #1, LVM: sanity-6db7a339756c86301de2b2017abf4cc2ca66a1d52982f66e7ac0299d ndbus0region0fsdax -wi-a----- 4.00m", "host #1, LVM: sanity-fcd36a1f738ddb2a778fc0c2db31a15d03734daf8967525aa6698efd ndbus0region0fsdax -wi-a----- 4.00m", "host #1, LVM: ", "host #1, direct: [", "host #1, direct: {", "host #1, direct: \"dev\":\"namespace0.1\",", "host #1, direct: \"mode\":\"fsdax\",", "host #1, direct: \"map\":\"dev\",", "host #1, direct: \"size\":1073741824,", "host #1, direct: \"uuid\":\"518a57c1-9ba0-11eb-9a15-86510ed27694\",", "host #1, direct: \"sector_size\":512,", "host #1, direct: \"align\":1073741824,", "host #1, direct: \"blockdev\":\"pmem0.1\",", "host #1, direct: \"name\":\"sanity-0512c2daa4f8cd859c714b167ee80ed890e4208fb04471e4fe205451\"", "host #1, direct: },", "host #1, direct: {", "host #1, direct: \"dev\":\"namespace0.0\",", "host #1, direct: \"mode\":\"fsdax\",", "host #1, direct: \"map\":\"dev\",", "host #1, direct: \"size\":32212254720,", "host #1, direct: \"uuid\":\"6c79e657-9b9d-11eb-a703-0e16888583db\",", "host #1, direct: \"sector_size\":512,", "host #1, direct: \"align\":1073741824,", "host #1, direct: \"blockdev\":\"pmem0\",", "host #1, direct: \"name\":\"pmem-csi\"", "host #1, direct: }", "host #1, direct: ]", "host #1, direct: ", "host #2, LVM: ", "host #2, direct: [", "host #2, direct: {", "host #2, direct: \"dev\":\"namespace0.0\",", "host #2, direct: \"mode\":\"fsdax\",", "host #2, direct: \"map\":\"dev\",", "host #2, direct: \"size\":32212254720,", "host #2, direct: \"uuid\":\"6bfc18d7-9b9d-11eb-bd85-7e089b645596\",", "host #2, direct: \"sector_size\":512,", "host #2, direct: \"align\":1073741824,", "host #2, direct: \"blockdev\":\"pmem0\",", "host #2, direct: \"name\":\"pmem-csi\"", "host #2, direct: }", "host #2, direct: ]", "host #2, direct: ", "host intel#3, LVM: ", "host intel#3, direct: [", "host intel#3, direct: {", "host intel#3, direct: \"dev\":\"namespace0.0\",", "host intel#3, direct: \"mode\":\"fsdax\",", "host intel#3, direct: \"map\":\"dev\",", "host intel#3, direct: \"size\":32212254720,", "host intel#3, direct: \"uuid\":\"6c007833-9b9d-11eb-9e8f-4e1e819e52d7\",", "host intel#3, direct: \"sector_size\":512,", "host intel#3, direct: \"align\":1073741824,", "host intel#3, direct: \"blockdev\":\"pmem0\",", "host intel#3, direct: \"name\":\"pmem-csi\"", "host intel#3, direct: }", "host intel#3, direct: ]", "host intel#3, direct: "}
      	            	actual  : deploy.Volumes{"host #0, LVM: ", "host #0, direct: ", "host #1, LVM: sanity-09f3bdaa1cf7ba19a84b3d98f13566f15b5f7fa243af965cc3f3f72c ndbus0region0fsdax -wi-a----- 4.00m", "host #1, LVM: sanity-4c41bdae3a73008815097201e98b73cd93c7651d2f500c056a841a9b ndbus0region0fsdax -wi-a----- 4.00m", "host #1, LVM: sanity-6db7a339756c86301de2b2017abf4cc2ca66a1d52982f66e7ac0299d ndbus0region0fsdax -wi-a----- 4.00m", "host #1, LVM: sanity-fcd36a1f738ddb2a778fc0c2db31a15d03734daf8967525aa6698efd ndbus0region0fsdax -wi-a----- 4.00m", "host #1, LVM: ", "host #1, direct: [", "host #1, direct: {", "host #1, direct: \"dev\":\"namespace0.2\",", "host #1, direct: \"mode\":\"fsdax\",", "host #1, direct: \"map\":\"dev\",", "host #1, direct: \"size\":1073741824,", "host #1, direct: \"uuid\":\"3b665ace-9ba1-11eb-9a15-86510ed27694\",", "host #1, direct: \"sector_size\":512,", "host #1, direct: \"align\":1073741824,", "host #1, direct: \"blockdev\":\"pmem0.2\",", "host #1, direct: \"name\":\"sanity-b8f9f5e5110b6c7c2d7318c441a1fcde435bf48357f264cc2124267e\"", "host #1, direct: },", "host #1, direct: {", "host #1, direct: \"dev\":\"namespace0.1\",", "host #1, direct: \"mode\":\"fsdax\",", "host #1, direct: \"map\":\"dev\",", "host #1, direct: \"size\":1073741824,", "host #1, direct: \"uuid\":\"518a57c1-9ba0-11eb-9a15-86510ed27694\",", "host #1, direct: \"sector_size\":512,", "host #1, direct: \"align\":1073741824,", "host #1, direct: \"blockdev\":\"pmem0.1\",", "host #1, direct: \"name\":\"sanity-0512c2daa4f8cd859c714b167ee80ed890e4208fb04471e4fe205451\"", "host #1, direct: },", "host #1, direct: {", "host #1, direct: \"dev\":\"namespace0.0\",", "host #1, direct: \"mode\":\"fsdax\",", "host #1, direct: \"map\":\"dev\",", "host #1, direct: \"size\":32212254720,", "host #1, direct: \"uuid\":\"6c79e657-9b9d-11eb-a703-0e16888583db\",", "host #1, direct: \"sector_size\":512,", "host #1, direct: \"align\":1073741824,", "host #1, direct: \"blockdev\":\"pmem0\",", "host #1, direct: \"name\":\"pmem-csi\"", "host #1, direct: }", "host #1, direct: ]", "host #1, direct: ", "host #2, LVM: ", "host #2, direct: [", "host #2, direct: {", "host #2, direct: \"dev\":\"namespace0.0\",", "host #2, direct: \"mode\":\"fsdax\",", "host #2, direct: \"map\":\"dev\",", "host #2, direct: \"size\":32212254720,", "host #2, direct: \"uuid\":\"6bfc18d7-9b9d-11eb-bd85-7e089b645596\",", "host #2, direct: \"sector_size\":512,", "host #2, direct: \"align\":1073741824,", "host #2, direct: \"blockdev\":\"pmem0\",", "host #2, direct: \"name\":\"pmem-csi\"", "host #2, direct: }", "host #2, direct: ]", "host #2, direct: ", "host intel#3, LVM: ", "host intel#3, direct: [", "host intel#3, direct: {", "host intel#3, direct: \"dev\":\"namespace0.0\",", "host intel#3, direct: \"mode\":\"fsdax\",", "host intel#3, direct: \"map\":\"dev\",", "host intel#3, direct: \"size\":32212254720,", "host intel#3, direct: \"uuid\":\"6c007833-9b9d-11eb-9e8f-4e1e819e52d7\",", "host intel#3, direct: \"sector_size\":512,", "host intel#3, direct: \"align\":1073741824,", "host intel#3, direct: \"blockdev\":\"pmem0\",", "host intel#3, direct: \"name\":\"pmem-csi\"", "host intel#3, direct: }", "host intel#3, direct: ]", "host intel#3, direct: "}

      	            	Diff:
      	            	--- Expected
      	            	+++ Actual
      	            	@@ -1,2 +1,2 @@
      	            	-(deploy.Volumes) (len=62) {
      	            	+(deploy.Volumes) (len=73) {
      	            	  (string) (len=14) "host #0, LVM: ",
      	            	@@ -9,2 +9,13 @@
      	            	  (string) (len=18) "host #1, direct: [",
      	            	+ (string) (len=18) "host #1, direct: {",
      	            	+ (string) (len=32) "host #1, direct: \"mode\":\"fsdax\",",
      	            	+ (string) (len=29) "host #1, direct: \"map\":\"dev\",",
      	            	+ (string) (len=35) "host #1, direct: \"size\":1073741824,",
      	            	+ (string) (len=63) "host #1, direct: \"uuid\":\"3b665ace-9ba1-11eb-9a15-86510ed27694\",",
      	            	+ (string) (len=35) "host #1, direct: \"sector_size\":512,",
      	            	+ (string) (len=36) "host #1, direct: \"align\":1073741824,",
      	            	+ (string) (len=89) "host #1, direct: \"name\":\"sanity-b8f9f5e5110b6c7c2d7318c441a1fcde435bf48357f264cc2124267e\"",
      	            	+ (string) (len=19) "host #1, direct: },",
      	            	  (string) (len=18) "host #1, direct: {",
      	Test:       	direct-testing sanity Node Service should work

      /nvme/gopath/src/github.com/intel/pmem-csi/test/e2e/deploy/volumeleaks.go:78
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.

2 participants