Commit graph

8920 commits

Author SHA1 Message Date
Seebs
6d68e71933 make the checkpoint async 2021-12-17 15:09:25 -06:00
Seebs
806669fa0f make db able to fail out if it can't checkpoint, fix silly wrong-units error
PageMap uses "WALID", which is a WAL page ID relative to the "base" ID of the
WAL, rather than the wal page count you'd get just reading the file. So everything
it reports has a fixed offset at any given time. I think this may be left
over from a point where there were partial checkpoints. Anyway, the net
outcome is that each new transaction was getting different page IDs, but
the actual WAL pages did not always reflect that. Each checkpoint increases
the offset. This might imply that we can start having problems after
4 billion pages written even if most of them were redundant?

Anyway, with that fixed, this seems to work. I think.
2021-12-17 15:09:25 -06:00
Seebs
b8f59d922c checkpoint rework/refactoring: logger, async-ish checkpoint
Trying to make the checkpoint be asynchronous-at-all, and
also allowing it to log.
2021-12-17 15:09:25 -06:00
Seebs
a631e25dc5 refactor: removeTx responsible for getting/releasing its own lock
We change nothing substantive here, except that there's a window
between when a write transaction updates the root pages and when
it removes itself from the db tx list and possibly causes a checkpoint
where it's not holding the db lock.

The issue here is that we want to be able to *keep* the lock but
still return, so no one else can start transactions, but the specific
Rollback or Commit that removed the last outstanding transaction
doesn't block forever. This will, later, allow us to exercise
finer-grained control over when we allow transactions. This is
a separate commit so we can run the test suite against it, and
verify that this part in particular didn't break anything.
2021-12-17 15:09:25 -06:00
Seebs
5c889c72bd make test hit the lock harder
Discovered test was running slightly strange and spending an unreasonable
amount of time on rand.Intn(), possibly because we weren't caching the
value used as the loop condition. Tweaked that, also made the pool a
bit different. Now it takes ~50 seconds for benchtime 100x, and produces
a profile with a TON of time spent waiting on sleeps (expected) and
the condition variable for waiting on checkpoints (the thing we want
to measure, really).
2021-12-17 15:09:25 -06:00
Seebs
3ed4487ae2 scratch space for FB-992: create benchmark for checkpointing
Note also the commented-out debug printf in checkpoint, there as a
reference. This is interesting because it turns out that MOST of checkpoint
writes is not actually writing new pages in most cases.

The actual "pages in WAL : pages in map" ratio is typically around 30:1
apparently. This would likely be different in cases where we were
updating existing data, though.

This is scratch space to prep for an actual work. The final
results will likely be different.
2021-12-17 15:09:25 -06:00
souhailanoor
44b855d50b
Merge branch 'master' into fb1000 2021-12-17 11:46:25 -06:00
Souhaila Noor
2ca29e6018 addressed reviewer's comments and added more tests 2021-12-17 11:45:35 -06:00
Samir Patel
7ce07d4e4a settings 2021-12-17 11:42:02 -06:00
Samir Patel
3b58e887ed add group lenth check 2021-12-17 11:34:48 -06:00
Samir Patel
c2d51a2257 remove settings 2021-12-17 10:00:21 -06:00
Samir Patel
1555746ff1 test 2021-12-16 23:53:30 -06:00
Samir Patel
db2263465b tests 2021-12-16 23:39:58 -06:00
Samir Patel
e5866f5f9c comment out string checking in test 2021-12-16 22:08:16 -06:00
Samir Patel
a793ebc3c4 update config internal test 2021-12-16 21:56:54 -06:00
Samir Patel
4565cb714b update config internal test 2021-12-16 21:02:58 -06:00
Samir Patel
eb693beb0b add authN login test 2021-12-16 20:35:34 -06:00
Samir Patel
b082a318f3 move authN to its own package 2021-12-16 20:34:09 -06:00
Samir Patel
b37f13e5c5 rename 2021-12-16 20:33:23 -06:00
reese
65ab92f364
Merge pull request #1811 from molecula/fb-1027
[fb-1027] ensure field bit depth is set when restoring shard
2021-12-16 08:54:34 -06:00
reesporte
c59ce837b3 ensure field bit depth is set when restoring shard
we have to manually set the cache value here bc it wont get set until the node is restarted otherwise
2021-12-15 16:09:45 -06:00
Samir Patel
52625c70ab check auth enabled before handling auth requests 2021-12-15 15:42:56 -06:00
Samir Patel
0cb27bfdd3 Merge branch '54mir/authentication' of github.com:molecula/featurebase into 54mir/authentication 2021-12-15 14:54:41 -06:00
Samir Patel
10dbbb49c8 rename 2021-12-15 14:54:01 -06:00
Samir Patel
f0e287e40b handle logout and userinfo 2021-12-15 14:53:30 -06:00
Samir Patel
a1de086cd8 change scopes from string to slicee 2021-12-15 14:53:04 -06:00
Samir Patel
1bd935bb59 separate out authentication from auth 2021-12-15 14:52:16 -06:00
Samir Patel
213572bb78 add logout and userinfo endpoints 2021-12-15 14:51:45 -06:00
Souhaila Noor
484cbbcd09 fixed func name 2021-12-15 14:19:21 -06:00
souhailanoor
0c65485b0e
Merge branch 'master' into fb1000 2021-12-15 13:37:15 -06:00
Souhaila Noor
48913caafd renamed package to authz, inmplemented reviewer's feedback 2021-12-15 13:36:27 -06:00
Samir Patel
7d81c6e1c1 add defaults to conf 2021-12-15 12:39:14 -06:00
Matthew Jaffee
600494c724
Merge pull request #1810 from molecula/sup-126
[SUP-126] Defer unlock & rollback during rbf.DB.Begin()
2021-12-15 08:39:24 -06:00
Ben Johnson
7141662c03 Defer unlock & rollback during rbf.DB.Begin() 2021-12-15 07:16:30 -07:00
Samir Patel
a261aa9972 refactor auth.go 2021-12-13 23:13:19 -06:00
Samir Patel
4eee8a4245 change the way auth is instantiated, and send to handler 2021-12-13 23:12:04 -06:00
Samir Patel
541132a176 hash and block key cmd options 2021-12-13 23:10:29 -06:00
Samir Patel
bd81427dd5 load auth object into handler 2021-12-13 23:10:04 -06:00
Samir Patel
ee9416d53a move auth struct to config 2021-12-13 23:09:14 -06:00
Samir Patel
5e6aec6f60 add hash and block keys to conf file 2021-12-13 23:08:41 -06:00
souhailanoor
a8b198af99
Merge branch 'master' into fb1000 2021-12-13 14:15:09 -06:00
Hoang Pham
583a0293ce added Login page for testing with BE endpoint 2021-12-13 14:04:41 -06:00
tgruben
a52eda0510
Merge pull request #1808 from molecula/sup120
[SUP-120] use higher level iterator in order to account for ops log
2021-12-13 13:51:29 -06:00
Todd Gruben
c25ab78b03 use higherlevel iterator in order to account for ops log 2021-12-13 13:10:16 -06:00
Souhaila Noor
3c8a7384ba added reviewer's suggestions 2021-12-13 13:05:35 -06:00
Souhaila Noor
32228bb134 updated go.mod 2021-12-13 10:48:40 -06:00
Souhaila Noor
9e2cf81127 added unit tests 2021-12-13 10:35:56 -06:00
Samir Patel
3b257fe3cb remove settings 2021-12-11 14:10:34 -06:00
Samir Patel
b5c87e0f18 add auth endpoints 2021-12-11 00:11:30 -06:00
Samir Patel
29832a3140 add authorization 2021-12-10 16:45:20 -06:00