Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to support 'liteserv' #2117

Draft
wants to merge 41 commits into
base: master
Choose a base branch
from
Draft

Changes to support 'liteserv' #2117

wants to merge 41 commits into from

Conversation

snej
Copy link
Collaborator

@snej snej commented Aug 23, 2024

This branch contains all the LiteCore enhancements & fixes needed to implement the liteserv server.

  • Implemented the _changes endpoint of the REST API, all 3 modes (normal, longpoll, continuous.) The latter two modes often have to block waiting for new changes; the implementation using Listener::Task ensures these idle connections aren't blocking a thread or locking a database, so it should be very scalable.
  • Implemented a new _query endpoint for running queries.
  • Lots of changes to the _replicate endpoint:
    • collection support
    • channel & docID filter support
    • doesn't block until the replication completes (that way the client gets the session_id and can cancel it)
    • simplified the cancel API to take the session_id
    • added a C4Listener method to start a replication task
  • I made a bunch of improvements to the RequestResponse class, like chunked-encoding support, and the ability to flush output to the socket before finishing the request (so long responses don't allocate a lot of memory.)

@snej snej force-pushed the feature/changes-feed branch from 301b4af to ea4b302 Compare August 23, 2024 22:56
@cbl-bot
Copy link

cbl-bot commented Aug 23, 2024

Code Coverage Results:

Type Percentage
branches 66.42
functions 79.0
instantiations 33.64
lines 77.93
regions 73.76

@snej snej force-pushed the feature/changes-feed branch 5 times, most recently from a93a5cd to fce880d Compare August 28, 2024 00:27
@snej snej force-pushed the feature/changes-feed branch 2 times, most recently from 9f1c40f to 3e0870a Compare August 29, 2024 20:57
@snej snej changed the title Implemented changes feed for REST listener REST listener improvements for liteserv Sep 5, 2024
@snej snej force-pushed the feature/changes-feed branch from 9b374ba to d768e61 Compare September 6, 2024 17:08
@snej snej force-pushed the feature/changes-feed branch 2 times, most recently from c18b18a to e24e1a6 Compare November 8, 2024 20:58
@snej snej force-pushed the feature/changes-feed branch 2 times, most recently from 5343df2 to 69007df Compare November 20, 2024 20:29
snej added 11 commits December 4, 2024 16:20
If the pool is opened with a read-only db, then borrowWriteable()
should immediately throw NotWriteable, not wait for a db to be
returned and then throw Busy.
c4Replicator+Pool.hh defines factory functions to start a replicator
given a DatabasePool* not a C4Database*.
This shields callers from having to include c4DatabaseImpl.hh etc.,
which drag in a buttload of internal replicator headers.
Gives Task subclasses more control over when a finished task should
be removed from the listing. Needed for ChangesTask.
Return value is true if index was created or replaced,
false if nothing changed.
- clang-format
- BorrowedCollection retains its C4Collection
- Fixed warnings about out-of-order initializers
- Fixed some params that needed C4NULLABLE
- Removed unused SyncListener member variables
@snej snej force-pushed the feature/changes-feed branch from a2a887c to b12952a Compare December 5, 2024 00:21
snej added 9 commits December 4, 2024 16:50
CBL_CORE_API shouldn't be used on the _definitions_ of data values,
only their _declarations_.
Removing changes that became unnecessary
adding some LIFETIMEBOUND
This occurs when EdgeServer sends an HTTP response but the client
has closed the socket.
clang-format reformats the declaration of "challengeAuth" weirdly,
with a two-line comment that has a '\' at the end of the first line.
GCC warns about this with -Wall.
Moved the doc-comment above the declaration to prevent this.
Internally, I streamlined the RecordEnumerator API by folding the
other initialization parameters into the Options struct.
@snej snej force-pushed the feature/changes-feed branch from edcb1c0 to 49ca97c Compare December 10, 2024 01:29
@snej snej changed the title REST listener improvements for liteserv Changes to support 'liteserv' Dec 11, 2024
@snej snej force-pushed the feature/changes-feed branch from 452fd24 to 555bd56 Compare December 11, 2024 18:58
borrrden and others added 5 commits December 12, 2024 07:32
- ICU is now downloaded as part of the build
- No more top level build server CMake wrapper is needed
- LiteCore and LiteCoreStatic targets can be disabled to avoid having needless install output
- Move sTempDir into LogEncoderTest.cc so it can be shared between CppTests and cbl-logtest
for EdgeServer, as part of creating Etags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants