Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
c925627
Work on rocksdb-js integration
cb1kenobi Jun 30, 2025
105cc09
Default to RocksDB
cb1kenobi Jul 9, 2025
dcda017
Work
cb1kenobi Jul 11, 2025
a26941d
More work
cb1kenobi Jul 12, 2025
4f34756
work
cb1kenobi Jul 15, 2025
ccdf5c4
Remove debug
cb1kenobi Jul 16, 2025
f2c1c10
Cleanup
cb1kenobi Jul 16, 2025
1a249e7
Work
cb1kenobi Jul 18, 2025
0fb219f
Work
cb1kenobi Jul 21, 2025
be5f66f
Cleanup
cb1kenobi Jul 21, 2025
65f16c5
Fix
cb1kenobi Jul 21, 2025
bbde402
Work
cb1kenobi Jul 21, 2025
29ad5d5
Add env, fix types
cb1kenobi Jul 22, 2025
44eb609
Bug fixes
cb1kenobi Jul 22, 2025
9fbbff1
Update lock api
cb1kenobi Jul 25, 2025
4bcc86d
clearTimeout
cb1kenobi Jul 31, 2025
ff582dd
Fix getIdMappingRecord and aggregation
cb1kenobi Aug 12, 2025
ee595c3
Fix path ref and error code check for .DS_Store files
cb1kenobi Aug 12, 2025
d3c15fd
Misc
cb1kenobi Aug 12, 2025
e576559
Cleanup getEntry
cb1kenobi Aug 13, 2025
86a1cc1
Re-enable rocksdb-js
cb1kenobi Aug 13, 2025
ddbe26b
Small fixes
cb1kenobi Aug 15, 2025
83f4e41
Embed timestamp in values
cb1kenobi Aug 29, 2025
dac57d3
Timestamp stuff
cb1kenobi Aug 29, 2025
acd8383
Comment
cb1kenobi Sep 8, 2025
8910531
Re-enable analytics aggregration
cb1kenobi Sep 25, 2025
83d67dc
Branch into separate transaction classes for RocksDB for distinct tra…
kriszyp Oct 20, 2025
137b97b
DRY up some functions and cleanup
kriszyp Oct 20, 2025
bdbf741
More work on decoding
kriszyp Oct 20, 2025
699ef11
Add audit store adapter for RocksDB and pass transactions through to …
kriszyp Nov 13, 2025
f19444a
Get simple transaction log querying running
kriszyp Nov 14, 2025
9bbfee6
No need for audit store cleanup with RocksDB
kriszyp Nov 26, 2025
65ec92c
Merge fix
kriszyp Nov 26, 2025
392f4ae
Adding transaction log replay functionality
kriszyp Nov 26, 2025
2cc16c3
No need for resource cache now that we have RocksDB
kriszyp Nov 26, 2025
1f20532
Make sure all system tables are audited, use @harperdb/extended-itera…
kriszyp Dec 1, 2025
59d4eeb
Restore prefer-const rule
kriszyp Dec 1, 2025
d701515
Adjust default cache size for databases
kriszyp Dec 1, 2025
ca587c2
Get audit log size with Rocks, tolerate commit errors
kriszyp Dec 1, 2025
74672a5
Merge branch 'main' into rocksdb
kriszyp Dec 5, 2025
7bdbf96
Add indexing support for RocksDB
kriszyp Dec 6, 2025
035962e
Go through full indexing functionality when replaying logs
kriszyp Dec 6, 2025
5da5b8e
Default to new resource API
kriszyp Dec 6, 2025
11ba669
Merge branch 'default-to-new-resource-api' into rocksdb
kriszyp Dec 6, 2025
76bff62
Remove blobs immediately when they are no longer referenced
kriszyp Dec 6, 2025
b4fef91
Fix username access from modifying memory map
kriszyp Dec 6, 2025
3edd4a2
Fix accessing database size
kriszyp Dec 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 26 additions & 15 deletions components/componentLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import { PluginModule } from './PluginModule.ts';
import { platform } from 'node:os';
import { getEnvBuiltInComponents } from './Application.ts';
import { RocksDatabase } from '@harperdb/rocksdb-js';

Check failure on line 41 in components/componentLoader.ts

View workflow job for this annotation

GitHub Actions / Unit Test (Node.js v22)

Cannot find module '@harperdb/rocksdb-js' or its corresponding type declarations.

Check failure on line 41 in components/componentLoader.ts

View workflow job for this annotation

GitHub Actions / Unit Test (Node.js v20)

Cannot find module '@harperdb/rocksdb-js' or its corresponding type declarations.

Check failure on line 41 in components/componentLoader.ts

View workflow job for this annotation

GitHub Actions / Unit Test (Node.js v24)

Cannot find module '@harperdb/rocksdb-js' or its corresponding type declarations.

Check failure on line 41 in components/componentLoader.ts

View workflow job for this annotation

GitHub Actions / Build Harper (Node.js v24)

Cannot find module '@harperdb/rocksdb-js' or its corresponding type declarations.

Check failure on line 41 in components/componentLoader.ts

View workflow job for this annotation

GitHub Actions / Build Harper (Node.js v22)

Cannot find module '@harperdb/rocksdb-js' or its corresponding type declarations.

Check failure on line 41 in components/componentLoader.ts

View workflow job for this annotation

GitHub Actions / Build Harper (Node.js v20)

Cannot find module '@harperdb/rocksdb-js' or its corresponding type declarations.

const CF_ROUTES_DIR = resolvePath(env.get(CONFIG_PARAMS.COMPONENTSROOT));
let loadedComponents = new Map<any, any>();
Expand Down Expand Up @@ -74,7 +75,7 @@
});
}

export const TRUSTED_RESOURCE_PLUGINS = {

Check failure on line 78 in components/componentLoader.ts

View workflow job for this annotation

GitHub Actions / Unit Test (Node.js v22)

Exported variable 'TRUSTED_RESOURCE_PLUGINS' has or is using name 'AuthAuditLog' from external module "/home/runner/work/harper/harper/utility/logging/harper_logger" but cannot be named.

Check failure on line 78 in components/componentLoader.ts

View workflow job for this annotation

GitHub Actions / Unit Test (Node.js v20)

Exported variable 'TRUSTED_RESOURCE_PLUGINS' has or is using name 'AuthAuditLog' from external module "/home/runner/work/harper/harper/utility/logging/harper_logger" but cannot be named.

Check failure on line 78 in components/componentLoader.ts

View workflow job for this annotation

GitHub Actions / Unit Test (Node.js v24)

Exported variable 'TRUSTED_RESOURCE_PLUGINS' has or is using name 'AuthAuditLog' from external module "/home/runner/work/harper/harper/utility/logging/harper_logger" but cannot be named.

Check failure on line 78 in components/componentLoader.ts

View workflow job for this annotation

GitHub Actions / Build Harper (Node.js v24)

Exported variable 'TRUSTED_RESOURCE_PLUGINS' has or is using name 'AuthAuditLog' from external module "/home/runner/work/harper/harper/utility/logging/harper_logger" but cannot be named.

Check failure on line 78 in components/componentLoader.ts

View workflow job for this annotation

GitHub Actions / Build Harper (Node.js v22)

Exported variable 'TRUSTED_RESOURCE_PLUGINS' has or is using name 'AuthAuditLog' from external module "/home/runner/work/harper/harper/utility/logging/harper_logger" but cannot be named.

Check failure on line 78 in components/componentLoader.ts

View workflow job for this annotation

GitHub Actions / Build Harper (Node.js v20)

Exported variable 'TRUSTED_RESOURCE_PLUGINS' has or is using name 'AuthAuditLog' from external module "/home/runner/work/harper/harper/utility/logging/harper_logger" but cannot be named.
REST, // for backwards compatibility with older configs
rest: REST,
graphql: graphqlQueryHandler,
Expand Down Expand Up @@ -116,16 +117,23 @@
return new Promise<void>((resolve, reject) => {
// Create timeout to avoid deadlocks
const timeout = setTimeout(() => {
Status.primaryStore.unlock(componentDirectory, 0);
store.unlock(componentDirectory, 0);
reject(new Error('symlinking harperdb module timed out'));
}, 10_000);
if (
// Get lock for this component
Status.primaryStore.attemptLock(componentDirectory, 0, () => {
clearTimeout(timeout);
resolve();
})
) {

const callback = () => {
clearTimeout(timeout);
resolve();
};
const store = Status.primaryStore;
const lockAcquired =
store instanceof RocksDatabase
? store.tryLock(componentDirectory, callback)
: store.attemptLock(componentDirectory, 0, callback);

if (!lockAcquired) {
clearTimeout(timeout);
} else {
try {
// validate node_modules directory exists
const nodeModulesDir = join(componentDirectory, 'node_modules');
Expand All @@ -151,7 +159,7 @@
resolve();
} finally {
// finally release the lock
Status.primaryStore.unlock(componentDirectory, 0);
store.unlock(componentDirectory, 0);
}
}
});
Expand All @@ -175,12 +183,15 @@
throw new Error(`Invalid timeout value for ${scope.name}. Expected a number, received: ${typeof timeout}`);
}
let whenResolved, timer;
if (
!Status.primaryStore.attemptLock(scope.name, 0, () => {
clearTimeout(timer);
whenResolved(sequentiallyHandleApplication(scope, plugin));
})
) {
const callback = () => {
clearTimeout(timer);
whenResolved(sequentiallyHandleApplication(scope, plugin));
};
const store = Status.primaryStore;
const lockAcquired =
store instanceof RocksDatabase ? store.tryLock(scope.name, callback) : store.attemptLock(scope.name, 0, callback);

if (!lockAcquired) {
return new Promise((resolve, reject) => {
whenResolved = resolve;
timer = setTimeout(() => {
Expand Down
2 changes: 1 addition & 1 deletion dataLayer/harperBridge/ResourceBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
}

return table.search(
{

Check failure on line 69 in dataLayer/harperBridge/ResourceBridge.ts

View workflow job for this annotation

GitHub Actions / Unit Test (Node.js v22)

Argument of type '{ conditions: Conditions; operator: string; limit: number; offset: number; reverse: boolean; select: any; sort: Sort<any>; allowFullScan: true; }' is not assignable to parameter of type 'Id | RequestTarget'.

Check failure on line 69 in dataLayer/harperBridge/ResourceBridge.ts

View workflow job for this annotation

GitHub Actions / Unit Test (Node.js v20)

Argument of type '{ conditions: Conditions; operator: string; limit: number; offset: number; reverse: boolean; select: any; sort: Sort<any>; allowFullScan: true; }' is not assignable to parameter of type 'Id | RequestTarget'.

Check failure on line 69 in dataLayer/harperBridge/ResourceBridge.ts

View workflow job for this annotation

GitHub Actions / Unit Test (Node.js v24)

Argument of type '{ conditions: Conditions; operator: string; limit: number; offset: number; reverse: boolean; select: any; sort: Sort<any>; allowFullScan: true; }' is not assignable to parameter of type 'Id | RequestTarget'.

Check failure on line 69 in dataLayer/harperBridge/ResourceBridge.ts

View workflow job for this annotation

GitHub Actions / Build Harper (Node.js v24)

Argument of type '{ conditions: Conditions; operator: string; limit: number; offset: number; reverse: boolean; select: any; sort: Sort<any>; allowFullScan: true; }' is not assignable to parameter of type 'Id | RequestTarget'.

Check failure on line 69 in dataLayer/harperBridge/ResourceBridge.ts

View workflow job for this annotation

GitHub Actions / Build Harper (Node.js v22)

Argument of type '{ conditions: Conditions; operator: string; limit: number; offset: number; reverse: boolean; select: any; sort: Sort<any>; allowFullScan: true; }' is not assignable to parameter of type 'Id | RequestTarget'.

Check failure on line 69 in dataLayer/harperBridge/ResourceBridge.ts

View workflow job for this annotation

GitHub Actions / Build Harper (Node.js v20)

Argument of type '{ conditions: Conditions; operator: string; limit: number; offset: number; reverse: boolean; select: any; sort: Sort<any>; allowFullScan: true; }' is not assignable to parameter of type 'Id | RequestTarget'.
conditions: searchObject.conditions,
//set the operator to always be lowercase for later evaluations
operator: searchObject.operator ? searchObject.operator.toLowerCase() : undefined,
Expand Down Expand Up @@ -459,7 +459,7 @@
}

resetReadTxn(schema, table) {
getTable({ schema, table })?.primaryStore.resetReadTxn();
getTable({ schema, table })?.primaryStore.resetReadTxn?.();
}

async deleteAuditLogsBefore(deleteObj) {
Expand Down
4 changes: 3 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ export default defineConfig([
extends: ['js/recommended'],
languageOptions: { globals: globals.node },
// Customize rules for all files here
rules: {},
rules: {
'prefer-const': 'off',
},
},
{
files: ['**/*.js'],
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
"@fastify/compress": "~6.5.0",
"@fastify/cors": "~9.0.1",
"@fastify/static": "~7.0.4",
"@harperdb/extended-iterable": "^1.0.1",
"@turf/area": "6.5.0",
"@turf/boolean-contains": "6.5.0",
"@turf/boolean-disjoint": "6.5.0",
Expand Down
Loading
Loading