-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initial CockroachDB support (partial)
The following changes are made to support CockroachDB (crdb): - Detecting use of cockroach. - Removal of custom PostgreSQL types (i.e. `vin_t` and `vout_t`) and related code since crdb does not support them. - Not erroring out when checking PostgreSQL-specific information (e.g. `synchronous_commit` and almost all the `pg_settings` dumped in the table at startup). - Setting the `sql_sequence` SERIAL operating mode since by default `SERIAL` type columns in crdb do not create a sequence. - Empty arrays made using the `ARRAY[]` constructor in CockroachDB require type _annotation_ (e.g. `ARRAY[]:::BIGINT[]` with ***three*** `:` characters for annotation instead of conversion), a concept that does not exist in PostgreSQL). May need to use the literal format like `SELECT '{}'::int[];` or whatever works for both PostgreSQL and CockroachDB. - Replaces `cardinality(arr)` with `array_length(arr,1)` since crdb does not have `cardinality` - Update README.md files for cockroachdb - Replace DELETE USING with subquery statements - Prevent too many versions of nextval() during bulk inserts using autoincrement of row primary key by lowering garbage the collection interval (from 25 hours!) to 20 minutes. - Note that update permissions may be required for zone config. - Remove dups with alternate queries that do not oom on cockroach - Deleting a unique index requires CASCADE Also: - Remove the `updateAllVotes` option from `ChainDB` sync since it is always done on the fly. For now, let `StoreBlock` keep the option to update ticket/vote spend info. Also keep `(*ChainDB).UpdateSpendingInfoInAllTickets` as it could be a helpful recovery and repair function. - `HeightDB`, `HashDB`, and `HeightHashDB` now use `DBBestBlock` to get the data from the `meta` table. See `HeightDBLegacy`, etc. for the querying the `blocks` table instead. - Before sync, check the `ibd_complete` flag in the meta `table` and force indexing and full update of `addresses` table spending info as required. - Remove unused code and comments from dcrpg/internal code.
- Loading branch information
Showing
20 changed files
with
703 additions
and
331 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.