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

neofs-lens: storage status new command #2591

Merged
merged 1 commit into from
Oct 12, 2023

Conversation

AliceInHunterland
Copy link
Contributor

@AliceInHunterland AliceInHunterland commented Sep 25, 2023

New command:

neofs-lens storage status --address ApueGak8ZwgXtxhhV3Bf97sbuByBDFkJSAZ4921g7hUr/E6bMcEHxjnrMRaRx5fjPe6WGsFS3jW9Q6SmMvHSskmNr  --config ./data/config/config-sn.yaml

Expected result looks like:

Shard ID:  7cCVnpBHZMZdfo8GfhKCSf
	Substorage  0
		Blob Type:  peapod
		Blob Path:  ./data/peapod1.db
		Blob Error:  status: code = 2049 message = object not found
	Substorage  1
		Blob Type:  fstree
		Blob Path:  ./data/fstree1
		Blob Error:  status: code = 2049 message = object not found
	Metabase
		Metabase storage ID:  
		Metabase path:  ./data/meta1
		Metabase object status:  NOT IN GRAVEYARD
		Metabase object error:  <nil>
	Writecache
		Writecache DB path:  
		Writecache DB error:  <nil>
		Writecache  FSTree path:  
		Writecache FSTree error:  <nil>
Shard ID:  QQD7WcPs6crwwSSZ3A3Ak6
	Substorage  0
		Blob Type:  blobovnicza
		Blob Path:  ./data/blob/blobovnicza
		Blob Error:  <nil>
	Substorage  1
		Blob Type:  fstree
		Blob Path:  ./data/blob
		Blob Error:  status: code = 2049 message = object not found
	Metabase
		Metabase storage ID:  0/0
		Metabase path:  ./data/metabase.db
		Metabase object status:  AVAILABLE NOT IN GRAVEYARD
		Metabase object error:  <nil>
	Writecache
		Writecache DB path:  data/wc0/small.bolt
		Writecache DB error:  object not found
		Writecache  FSTree path:  ./data/wc0
		Writecache FSTree error:  object not found

In the initial issue was proposed to display only parts of the storage where the object belongs. As for now, this command displays all parts of storage. what do you think about it? also, there is a question about word choice and error display.
Refs: #2550.

@codecov
Copy link

codecov bot commented Sep 25, 2023

Codecov Report

Merging #2591 (e9ffb8e) into master (1d7bd26) will decrease coverage by 0.09%.
The diff coverage is 0.00%.

❗ Current head e9ffb8e differs from pull request most recent head 4c1ab5e. Consider uploading reports for the commit 4c1ab5e to get more accurate results

@@            Coverage Diff             @@
##           master    #2591      +/-   ##
==========================================
- Coverage   29.71%   29.62%   -0.09%     
==========================================
  Files         411      416       +5     
  Lines       31431    31523      +92     
==========================================
  Hits         9339     9339              
- Misses      21280    21372      +92     
  Partials      812      812              
Files Coverage Δ
pkg/local_object_storage/writecache/writecache.go 77.55% <ø> (ø)
pkg/local_object_storage/shard/status.go 0.00% <0.00%> (ø)
pkg/local_object_storage/engine/status.go 0.00% <0.00%> (ø)
pkg/local_object_storage/blobstor/status.go 0.00% <0.00%> (ø)
pkg/local_object_storage/writecache/status.go 0.00% <0.00%> (ø)
pkg/local_object_storage/metabase/status.go 0.00% <0.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@AliceInHunterland AliceInHunterland force-pushed the feature/2550-neofs-lens-storage-status-command branch from 6163fa2 to 345cc44 Compare September 26, 2023 07:35
@AliceInHunterland AliceInHunterland marked this pull request as ready for review September 26, 2023 07:37
Copy link
Member

@roman-khimov roman-khimov left a comment

Choose a reason for hiding this comment

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

I'd try simplifying the interface, even though metabase one does require some specifics. And maybe only deal with cases where there is some data for the object, lots of inexistence errors are not very useful (we can have a lot of shards).

cmd/neofs-lens/internal/printers.go Outdated Show resolved Hide resolved
Blob blobstor.ObjectStatus
Metabase meta.ObjectStatus
Writecache writecache.ObjectStatus
Errors []error
Copy link
Member

Choose a reason for hiding this comment

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

It's really unobvious what this slice means without looking into the implementation.

cmd/neofs-lens/internal/printers.go Outdated Show resolved Hide resolved
cmd/neofs-lens/internal/printers.go Outdated Show resolved Hide resolved
res.State = append(res.State, "AVAILABLE")
}
if removedStatus == 1 {
res.State = append(res.State, "GC MARKED")
Copy link
Member

Choose a reason for hiding this comment

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

so in the worst scenario, could it print LOCKED AVAILABLE AVAILABLE GC MARKED?

Copy link
Contributor Author

@AliceInHunterland AliceInHunterland Sep 29, 2023

Choose a reason for hiding this comment

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

it could be such a situation when an object is inBucket and inGraveyardWithKey at the same time?

if so it could be LOCKED AVAILABLE AVAILABLE GC MARKED

Copy link
Member

Choose a reason for hiding this comment

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

"AVAILABLE AVAILABLE" is better be avoided, you can use some different terms.

Copy link
Member

Choose a reason for hiding this comment

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

i would expect printing statuses if they are interested, e.g.: a regular available object -- shard ID, if locked, another line in the print about it, if removed but locked -- one more line. if not found at all -- just "not found" line or smth like that

it could be such a situation when an object is inBucket

depends on what bucket we are talking about. but an object can be placed in a shard, be removed but be locked so LOCKED AVAILABLE AVAILABLE GC MARKED seems reachable (but not clear)

@AliceInHunterland AliceInHunterland force-pushed the feature/2550-neofs-lens-storage-status-command branch 2 times, most recently from 9067829 to 8222ff4 Compare September 29, 2023 11:52
@AliceInHunterland
Copy link
Contributor Author

AliceInHunterland commented Oct 2, 2023

@roman-khimov what do you mean by

metabase one does require some specifics

it seems that metabase does not have any other specifications.
for this moment we have:

neofs-lens storage status --address ApueGak8ZwgXtxhhV3Bf97sbuByBDFkJSAZ4921g7hUr/E6bMcEHxjnrMRaRx5fjPe6WGsFS3jW9Q6SmMvHSskmNr  --config ./data/config/config-sn.yaml
Shard ID:   QQD7WcPs6crwwSSZ3A3Ak6
            Substorage 0
               Blob Type:   blobovnicza
               Blob Path:   ./data/blob/blobovnicza
            Metabase
               Metabase storage ID:      0/0
               Metabase path:            ./data/metabase.db
               Metabase object status:   AVAILABLE NOT IN GRAVEYARD

@roman-khimov
Copy link
Member

I mean it differs from "normal" storages.

res.State = append(res.State, "AVAILABLE")
}
if removedStatus == 1 {
res.State = append(res.State, "GC MARKED")
Copy link
Member

Choose a reason for hiding this comment

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

"AVAILABLE AVAILABLE" is better be avoided, you can use some different terms.

pkg/local_object_storage/writecache/status.go Show resolved Hide resolved
pkg/local_object_storage/metabase/status.go Show resolved Hide resolved
cmd/neofs-lens/internal/printers.go Show resolved Hide resolved
res.State = append(res.State, "AVAILABLE")
}
if removedStatus == 1 {
res.State = append(res.State, "GC MARKED")
Copy link
Member

Choose a reason for hiding this comment

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

i would expect printing statuses if they are interested, e.g.: a regular available object -- shard ID, if locked, another line in the print about it, if removed but locked -- one more line. if not found at all -- just "not found" line or smth like that

it could be such a situation when an object is inBucket

depends on what bucket we are talking about. but an object can be placed in a shard, be removed but be locked so LOCKED AVAILABLE AVAILABLE GC MARKED seems reachable (but not clear)

pkg/local_object_storage/writecache/status.go Outdated Show resolved Hide resolved
@AliceInHunterland AliceInHunterland force-pushed the feature/2550-neofs-lens-storage-status-command branch from 8222ff4 to 39c2cfe Compare October 5, 2023 08:22
@AliceInHunterland AliceInHunterland force-pushed the feature/2550-neofs-lens-storage-status-command branch from 39c2cfe to 0be3397 Compare October 10, 2023 14:05
Copy link
Member

@roman-khimov roman-khimov left a comment

Choose a reason for hiding this comment

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

Please rebase again, the CHANGELOG has changed.

pkg/local_object_storage/writecache/status.go Outdated Show resolved Hide resolved
@AliceInHunterland AliceInHunterland force-pushed the feature/2550-neofs-lens-storage-status-command branch 2 times, most recently from 2549f5d to b9c6606 Compare October 11, 2023 19:44
This command prints out information about storage and its components,
where object is located. It can be useful for object inspection and
storage health check.

Refs: #2550.

Signed-off-by: Ekaterina Pavlova <[email protected]>
@AliceInHunterland AliceInHunterland force-pushed the feature/2550-neofs-lens-storage-status-command branch from b9c6606 to 4c1ab5e Compare October 11, 2023 19:49
@roman-khimov roman-khimov merged commit 41e17ce into master Oct 12, 2023
8 checks passed
@roman-khimov roman-khimov deleted the feature/2550-neofs-lens-storage-status-command branch October 12, 2023 06:17
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