Commit graph

48421 commits

Author SHA1 Message Date
Soham Kulkarni
8efd35768d
Merge pull request #29032 from sokumon/report-padding
fix(style): padding added in query-report view
2025-01-08 14:22:12 +05:30
Akhil Narang
4380216a82
Merge pull request #29072 from iamejaaz/field-alignment-issue
fix: spacing issue between field and label
2025-01-08 11:50:41 +05:30
Ankush Menat
59309f8164
perf: do not validate user on session resume (#29074)
* fix: Consume sid from arguments

* perf: do not validate user on resume

Errr, why would we ever need to validate if user with active session is
"disabled"?

When active user is disabled, their sessions are wiped from cache and DB.
2025-01-07 12:52:23 +00:00
Ankush Menat
77c9c9ee93
perf: hard-code /app routing even more aggresively (#29073)
Dynamic route evaluation is insanely slow and done on each request. I'll
likely remove that over time but in meantime, this resolution should be
much higher.
2025-01-07 12:32:28 +00:00
Ankush Menat
fdba41c682
perf: misc client cache improvements (#29070)
* perf: Reduce penalty for lack of redis connection

If redis isn't running than this client cache is slower than default
implementation because of the extra locking overhead.

* test: update perf redis counts

* perf: cache table columns in client-cache

* fix: race condition on cache-client_cache init

Rare but apparant in synthetic benchmarks.

Cache is set but client cache is still being initialized then request
will fail.

* perf: Don't run notifications when loading document

WHAT?

* fix: use cached doc to repopulate

* perf: reduce get_meta calls
2025-01-07 16:14:43 +05:30
Ejaaz Khan
213b76a9e9 fix: spacing issue between field and label 2025-01-07 16:12:11 +05:30
Deepesh Garg
8e101182f2
Merge pull request #29038 from deepeshgarg007/linked_doctypes
perf: Ignoring linked doctypes on cancel
2025-01-07 15:49:42 +05:30
Deepesh Garg
0acee8a947 chore: linting issues 2025-01-07 14:19:38 +05:30
Ankush Menat
f50518c17e
Merge pull request #29066 from ankush/skip_client_cache
fix: Make client cache work without redis too
2025-01-07 13:57:32 +05:30
Ankush Menat
b9c0662de6 fix: Make client cache work without redis too 2025-01-07 13:46:47 +05:30
Ankush Menat
939f832e01
Merge pull request #28992 from ankush/perf/client_side_redis_cache
feat(cache): server-assisted client-side caching
2025-01-07 13:20:58 +05:30
Ankush Menat
06816f2817 perf: client-cache for defaults 2025-01-07 12:51:10 +05:30
Ankush Menat
d3dd7651dc perf: cache parsed fields aggresively
These are just simple strings, and default of 128 isn't enough. Just 4-5
list views will fill that up.
2025-01-07 12:10:11 +05:30
Akhil Narang
146adbed68
Merge pull request #29063 from barredterra/two-lines-in-img-view
feat: display two lines in image view
2025-01-07 12:00:41 +05:30
Ankush Menat
33bd1bc09b fix: Flushall shouldn't attempt reading keys 2025-01-07 11:56:22 +05:30
Ankush Menat
b5e2569c0c feat: statistics for cache performance
These can be used for logging or debugging the behaviour of the cache.
2025-01-07 11:47:52 +05:30
Ankush Menat
8dd4ad53e2 fix: data race between GET and INVALIDATE
Fix for the documented example given here: https://redis.io/docs/latest/develop/reference/client-side-caching/#avoiding-race-conditions
2025-01-07 11:09:42 +05:30
barredterra
a0b9f02acf feat: display two lines in image view 2025-01-06 22:02:07 +01:00
Ankush Menat
73dc99275d refactor: move get_system_settings
- This should not be in init.py
- set_single_value is not a good alternate for properly cleaning up cache.
2025-01-06 20:31:38 +05:30
Ankush Menat
b7ddd1df92 perf: cache hooks in client-side cache 2025-01-06 20:24:27 +05:30
Ankush Menat
e37219ef39 perf: Store languages in client cache 2025-01-06 19:52:43 +05:30
Ankush Menat
b60a1292bd perf: store app-module mappings in client cache 2025-01-06 19:46:42 +05:30
Ankush Menat
dfc6dcb6b8 Revert "perf: Avoid checking server script map (#29057)"
This reverts commit 55a55e7f7b.
2025-01-06 19:43:53 +05:30
Ankush Menat
c76b23a050 perf: cache server script map in client cache 2025-01-06 19:43:28 +05:30
Ankush Menat
7ea0421624 perf: cache system settings in client side cache 2025-01-06 19:40:07 +05:30
Ankush Menat
c14d416d19 docs: add usage / notes in code 2025-01-06 19:28:37 +05:30
Ankush Menat
15f5adc25a refactor: use namedtuple for readability 2025-01-06 19:28:33 +05:30
Ankush Menat
b51cfc1705 perf: minimize penalty for broken client cache 2025-01-06 18:57:57 +05:30
Ankush Menat
119af71ae3 refactor: variable names, force RESP2 2025-01-06 18:57:57 +05:30
Ankush Menat
98b1df7dac fix: guard all writes with an RLock 2025-01-06 18:57:57 +05:30
Ankush Menat
53f085e0f4 test: ttl and maxsize 2025-01-06 18:57:57 +05:30
Ankush Menat
55ae5615d0 fix: clear all meta cache only when doctype is not specified 2025-01-06 18:57:57 +05:30
Ankush Menat
f332852415 fix: start tracking keys set by us immediately 2025-01-06 18:57:57 +05:30
Ankush Menat
4518b4562f test: add basic client cache tests 2025-01-06 18:57:57 +05:30
Ankush Menat
8f2f94b7e5 test: make redis query count util work with any redis instance 2025-01-06 18:57:57 +05:30
Ankush Menat
f74ada155e fix: Don't serve local cache values when it becomes unhealthy 2025-01-06 18:57:57 +05:30
Ankush Menat
29733febcb refactor: minor cleanup / avoid repeat calls
This get+conditional set is also slightly prone to data races, but
doesn't seem to be harmful as of now.

Rationale:
- To enable recorder one must first send a request, so this should be
  set long before.
- While enabling we can accidentally clear cache for another worker by
  invalidating it, but that is kind of acceptable behaviour. We ONLY set
  it to False when `None` is received from Redis. Local invalidations
  remove it completely.
2025-01-06 18:57:57 +05:30
Ankush Menat
45d414fe29 refactor: per-key TTL 2025-01-06 18:57:57 +05:30
Ankush Menat
0a85992331 fix: avoid clearing client cache for single doctype
Similar to recent _SITE_CACHE change, it's not required.

Properly cleared keys will get invalidated anyway.
2025-01-06 18:57:57 +05:30
Ankush Menat
21f0cda732 refactor: Reuse original cache connection
Drops redis connection per worker from 3 to 2!

Nothing wrong with doing this.
2025-01-06 18:57:57 +05:30
Ankush Menat
01cfa647a2 fix: set/del locally too
This is required if we do NOLOOP
2025-01-06 18:57:57 +05:30
Ankush Menat
e7139a1395 perf: store meta in client cache 2025-01-06 18:57:57 +05:30
Ankush Menat
cd47bee65e fix: Avoid data races by accessing request specific cache
Imagine:
| client 1 | client 2 |
| ---      | ---      |
| rd(x)    |          |
|          |  wr(x)   |
| inv(x)   |          |
| rd(x)    |          |  <- This will end up using request specific cache!
2025-01-06 18:57:57 +05:30
Ankush Menat
764c3134cb fix: expire client cache every 10 minutes
We can be more aggressive later, this is a good starting parting.
2025-01-06 18:57:57 +05:30
Ankush Menat
a3c48da7f4 perf: enable client side caching for recorder flag 2025-01-06 18:57:57 +05:30
Ankush Menat
796e51df62 fix: limit # of keys by maxsize
Picking 1024 keys assuming 4kb avg size. In practice most things are
smaller so 1024 should be good enough!

This will likely only affect multitenant deploy with many sites.
2025-01-06 18:57:57 +05:30
Ankush Menat
590e7ff185 fix: Ensure that RESP3 is not in use
One can set it in conf and it won't work as expected because pubsub
format is different
2025-01-06 18:57:57 +05:30
Ankush Menat
67848aa920 fix: handle temporary disconnects 2025-01-06 18:57:57 +05:30
Ankush Menat
e21a7112e9 fix: flushall handler
Also no need to check channel names?
2025-01-06 18:57:57 +05:30
Ankush Menat
b96b8c815d feat: Initate client-side caching 2025-01-06 18:57:57 +05:30