Commit Graph

7 Commits

Author SHA1 Message Date
Jesse Hallam
4286456077 MM-10856: deduplicate posts with the same pending post id (#10006)
* MM-10856: deduplicate posts with the same pending post id

Leverage a fixed size cache with a window of 30 seconds to deduplicate posts received by a single app server. Clients that duplicate the same pending post id will see one request potentially delayed until the first finishes, after which the same payload should be returned by both.  Duplicate posts outside the 30 second window will not be de-duplicated.

Note that the cache is not synchronized between app servers. In an HA cluster consisting of more than one app server, sticky load balancing (e.g. hashing by IP or Session ID) is required to route the users to the same app instance for multiple requests.

Other options considered for this feature:
* adding a column to the `Posts` table: rejected as being too heavyweight
* maintaining a `PendingPostIds` table: similarly rejected for the database impact
* using the pending post id as the post id and relying on the unique constraints on the Post table: rejected for being difficult to show that it's safe to use a client-provided value as the row identifier

* utils/lru: simplify to ttl internally and for new methods

* move seenPendingPostIdsCache to App.Server

* just fail concurrent post requests, vs. trying to wait

* add debug log when create post is deduplicated
2018-12-17 15:16:57 -08:00
Chris
600528e1cf optimize lru purging (#8381) 2018-02-28 12:07:11 -08:00
Christopher Speller
09b49c26dd PLT-5308 Caching layer part 2 (#6973)
* Adding Reaction store cache layer example

* Implementing reaction store in new caching system.

* Redis for reaction store

* Adding redis library

* Adding invalidation for DeleteAllWithEmojiName and other minor enhancements
2017-07-31 08:15:23 -07:00
Pierre Rudloff
56dc863de1 Fix some typos in the English locale (fixes #4663) (#4793) 2016-12-21 19:29:38 -03:00
Elias Nahum
7b3be6c77e PLT-7: Refactoring manuatesting & utils to use translations (chunk 5)
- Add spanish translations
- Skip tests
2016-01-25 00:57:16 -03:00
=Corey Hulen
a3b10d0b01 fixing header 2015-06-22 10:41:41 -08:00
=Corey Hulen
56e74239d6 first commit 2015-06-14 23:53:32 -08:00