The existing logic would clean account paths only when we had secondary
access to the blockstore. However, the access mode shouldn't dictate
when we clean accounts data; we can and should clean account data from
previous runs in all instances given that we always start over from a
snapshot.
Introduce a struct to store all of the relevant slot/root information, and then output all in one go at the end as either human-readable or json. There are some slight changes to the human-readable format for the case of an empty ledger
Removed an "ok" print that occurs after several commands; we already
print a log statement that indicates ledger-tool is done and how long it
took. Additionally, switch a println to info to avoid polluting stdout
incase we want to print information in a more easily readable format
such as json.
* init copy cmd
* extract creating emulator connection logic
* extract copy args as struct
* add new_for_emulator
* add tryFrom confirmed block to versioned block
* implement bigtable copy command
* use 'force' flag to force upload
* use unwrap_or
* remove redundant importing
* fix nightly lint
* explicit transactions missing error
* process ending_slot
* prevent start slot > end slot
* print skip slots in debug level
* fix destination bigtable should not be readonly
* combine is-emulator and endpoint to emulated source. conflict with crenditial path
* wording
* log some error messages with error level
* nightly lint
* add dry-run
* extract create bigtable instances logic
* use a lighter way to check block
* use the latest futures version which is used in the repo
* use futures = "0.3"
Co-authored-by: Tyera <teulberg@gmail.com>
* wording
Co-authored-by: Tyera <teulberg@gmail.com>
* wording
Co-authored-by: Tyera <teulberg@gmail.com>
Co-authored-by: Tyera <teulberg@gmail.com>
Currently, if starting-slot is unspecified, a value of 0 will be chosen.
In the common case where someone is operating on a much more recent
range, this would result in a ton of wasted operations & time.
Instead, choose a smarter default value for starting-slot based on what
we detect is currently in the blockstore.
* Update cost model to use requested_cu instead of estimated cu #27608
* remove CostUpdate and CostModel from replay/tvu
* revive cost update service to send cost tracker stats
* CostModel is now static
* remove unused package
Co-authored-by: Tao Zhu <tao@solana.com>
A fifo rocksdb instance must be opened with max size parameter on the
fifo columns. To support this, we previously plumbed a constant up to
callers that provided a default if unbounded growth desired.
This change attempts to be more rusty by exposing an option for this
value, and converting the option to a constant at the lowest level
possible.
#### Summary of Changes
Removes the constant default for ShredStorageType::RocksFifo
as the shred storage size is either user-specified or derived
from --limit-ledger-size in #27459.
### Problem
When FIFO compaction is used while --rocksdb_fifo_shred_storage_size
is unspecified, the FIFO shred storage size is set to a const default based
on the default `--limit-ledger-size`.
### Summary of the Change
When --rocksdb_fifo_shred_storage_size is unspecified, it is now
derived from `--limit-ledger-size` by reserving 1500 bytes for each
shred.
#### Problem
The ledger-tool copy command currently assumes target_db uses the same
shred storage type as the source ledger.
#### Summary of Changes
This PR enables ledger-tool copy command to infer the target_db shred storage
type based on whether rocksdb or rocksdb_fifo exists under the target_db directory
(same way as how ledger-tool infers the shred storage type for the main db.)
If the ledger-tool is not able to infer the shred storage type of the target_db, then
the default level compaction will be used.