Skip to content

Commit fcf8914

Browse files
committed
Merge branch 'release_4.5'
2 parents ba7a0d4 + e8cad59 commit fcf8914

File tree

7 files changed

+25
-4
lines changed

7 files changed

+25
-4
lines changed

docs/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@
122122
* [Storage Algorithm](technical-details/reference/storage-algorithm.md)
123123
* [Release Notes](technical-details/release-notes/README.md)
124124
* [Harper Tucker (Version 4)](technical-details/release-notes/4.tucker/README.md)
125+
* [4.5.2](technical-details/release-notes/4.tucker/4.5.2.md)
125126
* [4.5.1](technical-details/release-notes/4.tucker/4.5.1.md)
126127
* [4.5.0](technical-details/release-notes/4.tucker/4.5.0.md)
127128
* [4.4.24](technical-details/release-notes/4.tucker/4.4.24.md)

docs/deployments/configuration.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,10 @@ When true, Harper will verify certificates against the Node.js bundled CA store.
270270

271271
Replication will first attempt to catch up using the audit log. If unsuccessful, it will perform a full table copy. When set to `false`, replication will only use the audit log.
272272

273+
`shard` - _Type_: integer;
274+
275+
This defines the shard id of this instance and is used in conjunction with the [Table Resource functions](../developers/replication/sharding#custom-sharding) `setResidency` & `setResidencyById` to programmatically route traffic to the proper shard.
276+
273277
***
274278

275279
### `clustering` using NATS

docs/developers/applications/caching.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,12 @@ export class MyTableEndpoint extends MyTable {
116116
117117
### Subscriptions
118118
119-
We can provide more control of an active cache with subscriptions. If there is a way to receive notifications from the external data source of data changes, we can implement this data source as an "active" data source for our cache by implementing a `subscribe` method. A `subscribe` method should return an asynchronous iterable that iterates and returns events indicating the updates. One straightforward way of creating an asynchronous iterable is by defining the `subscribe` method as an asynchronous generator. If we had an endpoint that we could poll for changes, we could implement this like:
119+
We can provide more control of an active cache with subscriptions. If there is a way to receive notifications from the external data source of data changes, we can implement this data source as an "active" data source for our cache by implementing a `subscribe` method. A `subscribe` method should return an asynchronous iterable that iterates and returns events indicating the updates. One straightforward way of creating an asynchronous iterable is by defining the `subscribe` method as an asynchronous generator. If we had an endpoint that we could poll for changes every second, we could implement this like:
120120
121121
```javascript
122122
class ThirdPartyAPI extends Resource {
123123
async *subscribe() {
124-
do {
124+
setInterval(() => { // every second retrieve more data
125125
// get the next data change event from the source
126126
let update = (await fetch(`http://some-api.com/latest-update`)).json();
127127
const event = { // define the change event (which will update the cache)
@@ -131,7 +131,7 @@ class ThirdPartyAPI extends Resource {
131131
timestamp: // the timestamp of when the data change occurred
132132
};
133133
yield event; // this returns this event, notifying the cache of the change
134-
} while(true);
134+
}, 1000);
135135
}
136136
async get() {
137137
...

docs/developers/replication/sharding.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,12 @@ class MyTable extends tables.MyTable {
6565
```
6666

6767
## Configuration for Static Sharding
68-
Alternatively, you can configure static sharding, where each node is assigned to a specific shard, and each record is replicated to the nodes in that shard based on the primary key. The `shard` is identified by a number. To configure the shard for each node, you can specify the shard number in the `replication`'s `routes` in the configuration:
68+
Alternatively, you can configure static sharding, where each node is assigned to a specific shard, and each record is replicated to the nodes in that shard based on the primary key. The `shard` is identified by a number. To configure the shard for each node, you can specify the shard number in the `replication`'s `shard` in the configuration:
69+
```yaml
70+
replication:
71+
shard: 1
72+
```
73+
Alternatively, you can configure the `shard` under the `replication` `routes`. This allows you to assign a specific shard id based on the routing configuration.
6974
```yaml
7075
replication:
7176
routes:

docs/technical-details/reference/globals.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ class Origin {
113113
}
114114
Cache.sourcedFrom(Origin);
115115
```
116+
- `login(username, password): Promise<void>` - This method can be called to start an authenticated session. The login will authenticate the user by username and password. If the authentication was successful, a session will be created and a cookie will be set on the response header that references the session. All subsequent requests from the client that sends the cookie in requests will be authenticated as the user that logged in and the session record will be attached to the request. This method returns a promise that resolves when the login is successful, and rejects if the login is unsuccessful.
117+
- `session` - This is the session object that is associated with current cookie-maintained session. This object is used to store session data for the current session. This is `Table` record instance, and can be updated by calling `request.session.update({ key: value })` or session can be retrieved with `request.session.get()`. If the cookie has not been set yet, a cookie will be set the first time a session is updated or a login occurs.
116118
- `_nodeRequest` - This is the underlying Node.js [`http.IncomingMessage`](https://nodejs.org/api/http.html#http_class_http_incomingmessage) object. This can be used to access the raw request data, such as the raw headers, raw body, etc. However, this is discouraged and should be used with caution since it will likely break any other server handlers that depends on the layered `Request` call with `Response` return pattern.
117119
- `_nodeResponse` - This is the underlying Node.js [`http.ServerResponse`](https://nodejs.org/api/http.html#http_class_http_serverresponse) object. This can be used to access the raw response data, such as the raw headers. Again, this is discouraged and can cause problems for middleware, should only be used if you are certain that other server handlers will not attempt to return a different `Response` object.
118120

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
### HarperDB 4.5.2
2+
3/25/2025
3+
4+
* For defined schemas, don't allow updates from remote nodes that could cause conflicts and repeated schema change requests
5+
* New harper-chrome docker container for accessing Chrome binaries for use with tools like Puppeteer
6+
* Improved rolling restart handling of errors with reaching individual nodes
7+
* Defined cleaner operation object to avoid accident leaking of credentials with logging

docs/technical-details/release-notes/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
[Meet Tucker](4.tucker/tucker.md) Our 4th Release Pup
66

7+
[4.5.2 Tucker](4.tucker/4.5.2.md)
8+
79
[4.5.1 Tucker](4.tucker/4.5.1.md)
810

911
[4.5.0 Tucker](4.tucker/4.5.0.md)

0 commit comments

Comments
 (0)