apache / shardingsphere-on-cloud

A collection of tools and best practices to take ShardingSphere into the cloud
Apache License 2.0
83 stars 28 forks source link

🐞 bug: PITR show backup records by csn , multiple backup csn records are the same, and only one record result is displayed. #463

Closed peilinqian closed 9 months ago

peilinqian commented 9 months ago

Environment

Issue description

./gs_pitr show --csn "44698"

Error log

Expected result

PITR show backup records by csn , multiple backup csn records are the same, and all records can be showed

mlycore commented 9 months ago

In LocalStorage's ReadByCSN https://github.com/apache/shardingsphere-on-cloud/blob/3d87f11c573c94bd9f02c206238b94dfdf3adaf7/pitr/cli/internal/pkg/local-storage.go#L175-L186

We can see that the first backup record who matches the requested CSN will be returned. And normally there should not have two or more backup records who share identical CSN.

This method ReadByCSN() could be kept and introduce another method ReadAllByCSN() to return all backup records containing the same CSN.