Commit graph

1972 commits

Author SHA1 Message Date
Alexander A. Klimov
f843b06288 Do x.UnixMilli(), not utils.UnixMilli(x)
and remove redundant utils.UnixMilli().
2022-04-14 12:59:37 +02:00
Alexander A. Klimov
2bc92cbab7 UnixMilli(x): don't overflow on 4/11/2262 (UTC)
but on 8/17/292278994 by not converting x into int64 ns and those to ms.
2022-04-14 12:59:37 +02:00
Julian Brost
e0859c55a0
Merge pull request #452 from Icinga/feature/generics
Enable generics
2022-04-14 12:55:40 +02:00
Julian Brost
0b730647e5
Merge pull request #460 from Icinga/bugfix/adjust-primary-key-incosistency
Schema: Adjust primary key irregularities of icon_image, notes_url & …
2022-04-11 11:14:50 +02:00
Yonas Habteab
8b5edd7802 Schema: Adjust primary key irregularities of icon_image, notes_url & action_url tables 2022-04-08 17:03:32 +02:00
Alexander A. Klimov
7b352c52db Merge Bulker and EntityBulker 2022-04-04 16:49:35 +02:00
Alexander A. Klimov
5b3a5cc163 Remove unused XMessageBulker 2022-03-30 13:40:26 +02:00
Alexander A. Klimov
b076f838bf Reuse generic com.Bulk() instead of redundant com.BulkXMessages() 2022-03-30 13:40:26 +02:00
Alexander A. Klimov
82cff812c6 Make Bulker generic 2022-03-30 13:40:26 +02:00
Alexander A. Klimov
55bb574304 Require Go v1.18+ 2022-03-30 13:40:24 +02:00
Alexander Aleksandrovič Klimov
d80543992d
Remove obsolete comment
That Go version doesn’t differ from the mainly used one.
2022-03-30 13:02:40 +02:00
Alexander Aleksandrovič Klimov
16027f8ab3
Merge pull request #454 from Icinga/dependabot/go_modules/github.com/lib/pq-1.10.4
Bump github.com/lib/pq from 1.10.3 to 1.10.4
2022-03-24 17:18:42 +01:00
dependabot[bot]
d87f317d76
Bump github.com/lib/pq from 1.10.3 to 1.10.4
Bumps [github.com/lib/pq](https://github.com/lib/pq) from 1.10.3 to 1.10.4.
- [Release notes](https://github.com/lib/pq/releases)
- [Commits](https://github.com/lib/pq/compare/v1.10.3...v1.10.4)

---
updated-dependencies:
- dependency-name: github.com/lib/pq
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-22 16:52:20 +00:00
Julian Brost
18de0a1297
Merge pull request #435 from Icinga/history-retention
History retention
2022-03-22 17:50:27 +01:00
Eric Lippmann
062dd95baf Add tests for cleanup and history retention 2022-03-22 16:07:54 +01:00
Eric Lippmann
c123276e2c Start history retention immediately 2022-03-22 15:55:04 +01:00
Eric Lippmann
17a7b026ce Add immediate option for periodic tasks 2022-03-22 15:55:04 +01:00
Eric Lippmann
01d9023098 Add indices for history retention 2022-03-22 15:55:04 +01:00
Ravi Kumar Kempapura Srinivasa
2c09dd9e1c Start history retention after config and state sync
Co-authored-by: Eric Lippmann <eric.lippmann@icinga.com>
2022-03-22 15:55:04 +01:00
Ravi Kumar Kempapura Srinivasa
73f4639d35 Document history retention configuration
Co-authored-by: Eric Lippmann <eric.lippmann@icinga.com>
2022-03-22 15:55:04 +01:00
Ravi Kumar Kempapura Srinivasa
c4c89c2cae Allow history retention configuration
Co-authored-by: Eric Lippmann <eric.lippmann@icinga.com>
2022-03-22 15:55:04 +01:00
Ravi Kumar Kempapura Srinivasa
5340805834 Introduce config.HistoryRetention
Co-authored-by: Eric Lippmann <eric.lippmann@icinga.com>
2022-03-22 15:55:04 +01:00
Ravi Kumar Kempapura Srinivasa
5b99f74062 Introduce history.Retention
Co-authored-by: Eric Lippmann <eric.lippmann@icinga.com>
2022-03-22 15:55:04 +01:00
Ravi Kumar Kempapura Srinivasa
5f4c36cc5b Introduce db.CleanupOlderThan()
Co-authored-by: Eric Lippmann <eric.lippmann@icinga.com>
2022-03-21 16:48:12 +01:00
Julian Brost
1da2dfdcce
Merge pull request #418 from Icinga/feature/postgresql-tests
Port integration tests to PostgreSQL
2022-03-16 16:06:24 +01:00
Julian Brost
02fd728579 Port integration tests to PostgreSQL 2022-03-15 15:17:19 +01:00
Julian Brost
89bcc99071
Merge pull request #221 from Icinga/feature/postgres-136
Support PostgreSQL
2022-03-15 14:35:01 +01:00
Eric Lippmann
3f6b303f4d Remove null bytes from strings
PostgreSQL does not allow null bytes in varchar, char and
text fields.
2022-03-10 17:07:06 +01:00
Alexander A. Klimov
d898681d3c Wrap "icingadb-*sql" in constants
refs #136
2022-03-10 17:07:06 +01:00
Alexander A. Klimov
53c0aa431f Postgres: replace ENUM DOMAINs with TYPEs
Before:

idb=# select * from icingadb_instance where responsible = 'y';
ERROR:  operator does not exist: boolenum = unknown
LINE 1: select * from icingadb_instance where responsible = 'y';
                                                          ^
HINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts.
idb=#

refs #136
2022-03-10 17:07:06 +01:00
Alexander A. Klimov
21ad40cf07 Docs: Postgres: explicitly set en_US.UTF-8
refs #136
2022-03-10 17:06:57 +01:00
Alexander A. Klimov
2cf4529cc0 Postgres: use case-insensitive CITEXT columns
not to require web to LOWER().

refs #136
2022-03-10 17:04:22 +01:00
Alexander A. Klimov
c3b8f80abf Decouple *SQL schema versions
refs #136
2022-03-10 17:04:22 +01:00
Alexander A. Klimov
b84fc62112 Simplify BulkChunkSplitPolicy
refs #136
2022-03-10 17:04:22 +01:00
Alexander A. Klimov
8da164c50f Throw BulkChunkSplitPolicy#Reset() away
refs #136
2022-03-10 17:04:22 +01:00
Alexander A. Klimov
10a70e8b71 Pass BulkChunkSplitPolicyFactory-s, not BulkChunkSplitPolicy-s
refs #136
2022-03-10 17:04:21 +01:00
Alexander A. Klimov
3eb14274dd DB#BuildDeleteStmt(): don't pre-rebind ?s
refs #136
2022-03-10 17:04:21 +01:00
Alexander A. Klimov
7f4b895ea9 NamedBulkExec(): allow custom BulkChunkSplitPolicy
By the way avoid duplicate rows in the same upsert chunk to avoid Postgres
error 21000 (ON CONFLICT DO UPDATE command cannot affect row a second time).

refs #136
2022-03-10 17:04:21 +01:00
Alexander A. Klimov
db2c3af769 BulkEntities(): allow custom BulkChunkSplitPolicy
refs #136
2022-03-10 17:04:21 +01:00
Alexander A. Klimov
d4f2c13d9c NewEntityBulker(): allow custom BulkChunkSplitPolicy
refs #136
2022-03-10 17:04:21 +01:00
Alexander A. Klimov
3854424a91 Introduce SplitOnDupId 2022-03-10 17:04:21 +01:00
Alexander A. Klimov
6b59f2e47c Introduce NeverSplit 2022-03-10 17:04:21 +01:00
Alexander A. Klimov
dccf02e11d Introduce BulkChunkSplitPolicy 2022-03-10 17:04:21 +01:00
Alexander A. Klimov
5b87fd94ee Don't re-invent sqlx.DB#Rebind()
refs #136
2022-03-10 17:04:21 +01:00
Alexander A. Klimov
908bb42004 Postgres: upsert: only handle primary key conflicts
refs #136
2022-03-10 17:04:21 +01:00
Alexander A. Klimov
eca23a95ed DB#Build*Stmt(): quote table names
Rationale: see https://dba.stackexchange.com/q/73136

refs #136
2022-03-10 17:04:21 +01:00
Alexander A. Klimov
db996b1839 Document Postgres support
refs #136
2022-03-10 17:04:19 +01:00
Alexander A. Klimov
1c3bfcf99d Support Postgres
refs #136
2022-03-09 18:49:45 +01:00
Alexander A. Klimov
ad895b560d Handle Postgres-specific errors
refs #136
2022-03-09 18:49:45 +01:00
Alexander A. Klimov
23d8938251 .github/workflows/compliance/anonymize-license.pl: handle github.com/lib/pq license
refs #136
2022-03-09 18:49:45 +01:00