Commit graph

5503 commits

Author SHA1 Message Date
Matthew Jaffee
0f67a0c432 first cut at automatic snapshotting
- had to make sure we don't snapshot until directive is fully applied
on a computer... otherwise there's races between loading the files and
truncating the write log.

- added a dirty bit to resources and a bool return to incrementing the
write log... don't snapshot if it returns false because that means
there's been no writes. (but make sure you close the storage transaction!)

- added the actually snapshotting routine which just fires every
<timeout> and serially snapshots everything.

- tweaked some logging

- added ability to get all tables in an org/db or literally all. I
think I just needed the "literally all", but it was natural to allow
it to be scoped to org or DB as well.

(cherry picked from commit b8b08bc9eb)
2023-01-10 23:26:29 +00:00
pokeeffe-molecula
f8120d4833 Consistency in error handling (fb-1799) (#2383)
* return 200 once plan compilation starts; if error, return error in response.

* removed some commented out code that is definitely not needed.

(cherry picked from commit 9dda3ff215)
2023-01-10 23:26:29 +00:00
Matthew Jaffee
dfd4bb1191 Expose translation mvcc (#2381)
* expose Transaction on TranslateStore for DAX Snapshotting

* try to fix ramdisk nonsense

apparently, we were running in either a shell env or docker env
randomly, so this could sometimes pass and sometimes fail since the
shell env had the ramdisk set up and docker didn't.

Now we force to run in docker always and set up ramdisk explicitly.

* debug ramdisk issue?

* fix tests... and a buncha other stuff

The executor test I modified failed when I changed DefaultPartitionN
to 8, but just because stuff was out of order so I made it more
robust.

I edited some data gen stuff to make shorter lines because it was
making grep results unusable.

the actual fix is in translate_boltdb_test.go

* clean up, fix code review feedback

(cherry picked from commit 3693b9950a)
2023-01-10 23:25:58 +00:00
pokeeffe-molecula
a6c165dd57 Implement DELETE (fb 1557) (#2382)
* delete implementation with test coverage

* optimize IN expressions; stop linter complaining

* fixed some uncovered query cases

* skip test in DAX for now

(cherry picked from commit 021219935f)
2023-01-10 23:25:08 +00:00
Bruce Baranowski
36c020f076 Fb 1818 Implement PREFIX() and SUFFIX() (#2371)
* Implement Prefix and Suffix
* Update substring out-of-index handling

(cherry picked from commit d19f3e81da)
2023-01-10 23:25:08 +00:00
tgruben
427f7a4494 Force make to use bash (#2380)
(cherry picked from commit 72d03602e0)
2023-01-10 23:25:08 +00:00
Matthew Jaffee
a9b248bb29 "fix" backup tar test by just comparing lengths not byte for byte
(cherry picked from commit 1e2e698225)
2023-01-10 23:25:08 +00:00
Matthew Jaffee
71c0624abb remove in mem translate store
(cherry picked from commit 7ab117f5d1)
2023-01-10 23:23:18 +00:00
Matthew Jaffee
da4a42dfe9 use separate qcx for write/read in test
now that min/max queries don't use a write Tx it seems we need to
separate read and write in the tests. Not sure I 100% understand this.

(cherry picked from commit a58299def4)
2023-01-10 23:22:58 +00:00
Matthew Jaffee
da85614c24 set transactions to writable: false for Max/Min/Value calls. these were mistakenly set to true during cleanup
(cherry picked from commit 53a8f58e91)
2023-01-10 23:22:58 +00:00
tgruben
24372a9405 [FB-1822] Change dataframe disk format to Arrow from parquet (#2376)
* change default backend to arrow file format instead of parquet

(cherry picked from commit 6d96a1474e)
2023-01-10 23:22:58 +00:00
Fletcher Haynes
2993ab5ca1 This fixes a bug with displaying errors returned from the SQL3 endpoint (#2374)
Co-authored-by: Fletcher Haynes <fletcher.haynes@generalassemb.ly>
(cherry picked from commit f65367ab46)
2023-01-10 23:22:58 +00:00
Lory Cloutier
5f15d3ad10 Fix bulk ingest queries on multi-node databases (#2375)
CLOUD-1252
Implemented Jaffee's fix of checking for b.useShardTransactionalEndpoint
and only running the start/finish transaction block if it's false. Moved
stats timing to a separate defer so it could stay out of the if.

(cherry picked from commit b1f5264a4b)
2023-01-10 23:22:58 +00:00
rachithrr
4aa34d3e1c FB-1815: Implement CHAR() (#2369)
(cherry picked from commit 27963441ab)
2023-01-10 23:22:58 +00:00
Travis Turner
99e3fd14d7 Fix PQL distinct in dax (#2360)
* Fix PQL distinct in dax

When issuing a PQL Distinct() call (or any other call with a "index=" arg),
this commit will attempt to convert the value in the index arg with a
TableKeyer.

* Apply change to call.Children as well

* Add some PQL Distinct (join) test coverage

(cherry picked from commit 4e8fe488de)
2023-01-10 23:22:58 +00:00
pokeeffe-molecula
211c3b759d add allow_missing_values option to bulk insert (fb-1823) (#2372)
* add allow_missing_values option to bulk insert

* test coverage

* review feedback

(cherry picked from commit 15d2ee8b07)
2023-01-10 23:22:58 +00:00
pokeeffe-molecula
bb2c805cac handling missing epoch constraint correctly (#2366)
(cherry picked from commit 843312dfc9)
2023-01-10 23:22:58 +00:00
pokeeffe-molecula
f42a33640a enable handling string representations of integers (#2367)
(cherry picked from commit 3528ec8fc0)
2023-01-10 23:22:58 +00:00
pokeeffe-molecula
4ef70c19da SHOW CREATE TABLE issues (fb-1810) (#2365)
* fixed ddl issues with cache type/size; removed shardwidth option; improved error message

(cherry picked from commit c88d60c9ab)
2023-01-10 23:22:58 +00:00
Matthew Jaffee
f6c0cf1112 rename stupid manager names
ManagerManager -> ResourceManager
Manager -> Resource

(cherry picked from commit 033be81799)
2023-01-10 23:22:58 +00:00
Matthew Jaffee
0e8773707a code review tweaks
(cherry picked from commit cf1c9dae9a)
2023-01-10 23:22:58 +00:00
Matthew Jaffee
9a441ef66b remove version/directive stuff from other snapshot endpoints
(cherry picked from commit 4366ad41fb)
2023-01-10 23:22:58 +00:00
Matthew Jaffee
41b865d838 clean up unused code/comments
(cherry picked from commit 3ddf79160f)
2023-01-10 23:22:54 +00:00
Matthew Jaffee
4d678faa72 fix dumb issue on storage manager test
changed empty snapshots/writelogs to return nil which was causing NPE

(cherry picked from commit bee666c07c)
2023-01-10 23:22:03 +00:00
Matthew Jaffee
bc3123ddd4 fix lint
(cherry picked from commit 797b8bc31f)
2023-01-10 23:22:03 +00:00
Matthew Jaffee
6cef68a853 several fixes and debug logging
- check that serverlessStorage is not nil before closing it
- check that we don't already hold a lock on a serverless storage
  Manager before trying to load it. This fixed at least one test failure.

(cherry picked from commit 87d1c31607)
2023-01-10 23:22:03 +00:00
Matthew Jaffee
76682753da implement closing on dax, remove all locks when shutting down
(cherry picked from commit dbb6d53f9d)
2023-01-10 23:22:03 +00:00
Matthew Jaffee
ff3595d759 more WIP
(cherry picked from commit bbaa7dd0f1)
2023-01-10 23:22:03 +00:00
Matthew Jaffee
ed7c6d419e extremely WIP
(cherry picked from commit 35c472a54f)
2023-01-10 23:22:03 +00:00
Matthew Jaffee
71e3c00b46 remove alpha director (unused)
(cherry picked from commit 690a9370e9)
2023-01-10 23:21:58 +00:00
rachithrr
e8ac1a0a7f FB-1812: implement stringsplit() (#2362)
(cherry picked from commit a4f18fb25f)
2023-01-10 23:21:31 +00:00
HHans09
766db38277 fb-1809: SQL3 RTrim & LTrim func for strings (#2361)
(cherry picked from commit c1dbc48fb2)
2023-01-10 23:20:52 +00:00
pokeeffe-molecula
b46a82ea33 added updated_at column to show tables output (#2364)
(cherry picked from commit 9759602f94)
2023-01-10 23:20:15 +00:00
pokeeffe-molecula
75999414a7 implement having; create view experiment (#2357)
(cherry picked from commit eca3168d63)
2023-01-10 23:20:15 +00:00
Bruce Baranowski
838bc2dadb FB-1719: implement SQL3 lower() (#2358)
* Implemented SQL3 LOWER()

(cherry picked from commit 4773aabc4e)
2023-01-10 23:20:15 +00:00
Lory Cloutier
748fdc3741 Prevent file corruption when writing tar backup to stdout (#2344)
* Prevent file corruption when writing tar backup to stdout

FB-1794

Tar backups written to stdout were coming out corrupt. This turned
out to be due to log messages getting written to stdout and ending
up in the tar file. We now check to see if the tar file and the log
are both going to stdout, and if they are, send the logs to stderr
instead.

Testing did not have any kind of consistency or validity check. We
now compare a tar file sent to a file and a tar file sent to stdout
to make sure they're the same. This does not guarantee correctness
but does at least catch this form of corruption.

* trying different index name

Co-authored-by: tgruben <tgruben@gmail.com>
Co-authored-by: Todd Gruben <todd@molecula.com>
(cherry picked from commit a8996a149d)
2023-01-10 23:20:15 +00:00
pokeeffe-molecula
f2442dcd88 fixed csv bugs (#2355)
(cherry picked from commit 2146f407c3)
2023-01-10 23:20:15 +00:00
Travis Turner
9e2dbadb82 Fix dax docker-compose (dc-up) which was broken by ServiceManager (#2356)
(cherry picked from commit e572c8f2c1)
2023-01-10 23:20:15 +00:00
tgruben
a2e14df15c Fb 1874 dataframe-csv-loader featurebase subcommand (#2341)
Embeded dataframe-csv-loader command as featurebase subservice

(cherry picked from commit f2a13c8bde)
2023-01-10 23:20:15 +00:00
HHans09
80626df411 fb-1802 : Trim functionality (#2353)
* fb-1802 : Trim functionality

rebase

* fb-1802 : trim - updated as per review

(cherry picked from commit ac3ffac8e6)
2023-01-10 23:20:15 +00:00
Travis Turner
20d7361566 Make interfaces more specific than "MDS" (#2352)
* Make interfaces more specific than "MDS"

- Introduce `dax.Schemar` interface
- Introduce `dax.Noder` interface
- The rest is generally to standardize on the new interfaces.
- Remove `pilosa.SchemaInfoAPI` interface
- Move `TranslateNode` and `ComputeNode` types from controller to dax package
- Remove `queryer.FeatureBaseImporter`
- Remove `queryer.MDS` interface
- Remove `queryer.Importer` interface
- Identify types using an "MDS" interface and split into Noder/Schemar as necessary
- Changed `Queryer.orchestrator` to a `map[qual]*qualifiedOrchestrator` because we can't share an orchestrator across quals

* Convert orchestrator to use TableKeyer

(cherry picked from commit 14f1930004)
2023-01-10 23:20:10 +00:00
Travis Turner
0127147d69 Thread Owner, UpdatedAt, UpdatedBy through SchemaAPI (#2351)
* Fix "qualifer" misspellings

* Remove `track_existence` and `shard_width` from SHOW TABLES output

* Thread Owner, UpdatedAt, UpdatedBy through SchemaAPI

I took the liberty of renaming "LastUpdatedUser" to "UpdateBy" to align
with "UpdatedAt".

(cherry picked from commit 63cfdb5078)
2023-01-10 23:19:19 +00:00
rachithrr
17188b7a7b FB-1805: implement REPLACEALL() (#2349)
(cherry picked from commit 9548e71f46)
2023-01-10 23:19:19 +00:00
Travis Turner
3ee936ebc8 Introduce TableKeyer interface; use in Execute() calls as "index" (#2350)
This commit introduces an interface called `TableKeyer` which anything that means to represent a "table"
can implement. Examples are `dax.QualifiedTable`, `dax.Table`, and `string` (for legacy pilosa calls
where Execute simply took `index string`).

In the case of `orchestrator.Execute()` and `qualifiedOrchestrator.Execute()`, we are intentionally strict
about which type of `TableKeyer` the respective method accepts. If we find, in the future, this is too
restrictive, we can loosen that; but for now it helps us understand what is expected.

(cherry picked from commit a61d1a9571)
2023-01-10 23:19:19 +00:00
Travis Turner
0cb16f0cf4 Remove trackExistence check in batch (i.e. always build _exists) data. (#2348)
(cherry picked from commit 5110405f2f)
2023-01-10 23:19:19 +00:00
Travis Turner
c7b4e47f10 Move batch.Importer interface to pilosa.Importer (#2347)
* Move batch.Importer interface to pilosa.Importer

In addition to moving the interface, it updates all the methods to use
dax.TableID (for example) intead of a string pilosa index name.

* Change unused onPremImporter methods to no-op.

onPremImporter is a wrapper around API which implements the Importer
interface. This is currently only used by sql3 running locally in standard
(i.e not "serverless") mode. Because sql3 always sets
`useShardTransactionalEndpoint = true`, There are several methods which this
implemtation of the Importer interface does not use, and therefore they
intentionally no-op.

(cherry picked from commit 12d608c80d)
2023-01-10 23:18:59 +00:00
HHans09
9346e26158 Fb:1787 - Clean up (#2339)
* Fb:1787 - Clean up

* fb-1787 : String upper function

* Formatting the files

(cherry picked from commit 57ce7c4c0e)
2023-01-10 23:18:38 +00:00
Travis Turner
c4532124e1 Add Table.Description, Table.CreatedAt, Field.CreatedAt support to SchemaAPI (#2340)
* Thread Table.Description through SchemaAPI

* Thread Table.CreatedAt through SchemaAPI

* Thread Field.CreatedAt through SchemaAPI

(cherry picked from commit 734477aaee)
2023-01-10 23:18:32 +00:00
rachithrr
c39e599086 FB-1800: Implement SUBSTRING() (#2343)
substring(string, startIndex,length).

(cherry picked from commit aa2a62fda0)
2023-01-10 23:18:19 +00:00
pokeeffe-molecula
eb54530de6 handle int-->bool map type conversions; handle single value-->(id|string)set map type conversions (#2342)
(cherry picked from commit 728b1dc9f5)
2023-01-10 23:18:07 +00:00