ozone icon indicating copy to clipboard operation
ozone copied to clipboard

HDDS-10568. When the ldb command is executed, it is output by line

Open jianghuazhu opened this issue 11 months ago • 12 comments

What changes were proposed in this pull request?

When executing the ldb command, if the data is very large, a very large file will be generated, which is not friendly. This pr will add a new function that can control the maximum number of records allowed to be saved in each file. Details: HDDS-10568

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-10568

How was this patch tested?

jianghuazhu avatar Mar 22 '24 09:03 jianghuazhu

The new command can be combined with --pre-file-records, using: ./bin/ozone debug ldb --db=/xxxx/xxxx/xxxx/om.db scan --column_family=fileTable --out=/xxxx/xxxx/xxxx/om/data/tmp_fileTable --pre-file-records=1000000

Effective file result set: image

jianghuazhu avatar Mar 22 '24 09:03 jianghuazhu

ci : https://github.com/jianghuazhu/ozone/actions/runs/8387158994

Can you help review this pr, @adoroszlai @xichen01 . Thanks.

jianghuazhu avatar Mar 22 '24 09:03 jianghuazhu

Can you help review this PR again, @xichen01 ? Thanks.

jianghuazhu avatar Mar 25 '24 05:03 jianghuazhu

Can you help review this pr, @kerneltime @errose28 . Thanks.

jianghuazhu avatar Mar 26 '24 02:03 jianghuazhu

/pending

adoroszlai avatar Apr 22 '24 11:04 adoroszlai

Sorry, I had some other work some time ago. I will make up for this issue in the near future.

jianghuazhu avatar Apr 26 '24 03:04 jianghuazhu

The unit tests run fine on my local machine: image

Can you help me look at this PR again, @errose28 @xichen01 . Thanks.

jianghuazhu avatar Apr 27 '24 09:04 jianghuazhu

https://github.com/apache/ozone/actions/runs/8849501009/job/24349282946?pr=6420 In CI, it is prompted that File-related operations cannot be performed, such as mkdirs(). Is it because it has something to do with our testing environment? @errose28 @kerneltime @adoroszlai , do you know the reason?

jianghuazhu avatar Apr 29 '24 02:04 jianghuazhu

In CI, it is prompted that File-related operations cannot be performed, such as mkdirs().

M B RV: Exceptional return value of java.io.File.mkdirs() ignored in org.apache.hadoop.ozone.debug.DBScanner.displayTable(ManagedRocksIterator, DBColumnFamilyDefinition, boolean)  At DBScanner.java:[line 232]

https://spotbugs.readthedocs.io/en/latest/bugDescriptions.html#rv-method-ignores-exceptional-return-value-rv-return-value-ignored-bad-practice

https://github.com/apache/ozone/blob/c7012f3bc91e92af08f2d89ee6ac1cbb103475d2/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/DBScanner.java#L228-L233

File.mkdirs() returns false if it could not create the directories. This return value needs to be handled (e.g. exit with error message).

M D NP: Possible null pointer dereference in org.apache.hadoop.ozone.debug.TestLDBCli.testScanWithRecordsPerFile() due to return value of called method  Dereferenced at TestLDBCli.java:[line 286]

https://spotbugs.readthedocs.io/en/latest/bugDescriptions.html#np-possible-null-pointer-dereference-due-to-return-value-of-called-method-np-null-on-some-path-from-return-value

https://github.com/apache/ozone/blob/c7012f3bc91e92af08f2d89ee6ac1cbb103475d2/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/debug/TestLDBCli.java#L285-L286

File.listFiles returns null if the path is not a directory. Try checking if tmpDir1 is a directory. The same applies to tmpDir2 below.

adoroszlai avatar Apr 29 '24 06:04 adoroszlai

ci: https://github.com/jianghuazhu/ozone/actions/runs/8876637070 I've updated it. Can you help me look at this PR again, @errose28 @xichen01 @adoroszlai ? Thanks.

jianghuazhu avatar Apr 29 '24 11:04 jianghuazhu

/ready

adoroszlai avatar Apr 29 '24 12:04 adoroszlai