querysub 0.417.0 → 0.418.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "querysub",
3
- "version": "0.417.0",
3
+ "version": "0.418.0",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "note1": "note on node-forge fork, see https://github.com/digitalbazaar/forge/issues/744 for details",
@@ -4,10 +4,9 @@
4
4
  import "../inject";
5
5
  import yargs from "yargs";
6
6
  let yargObj = yargs(process.argv)
7
- .option("shardcenter", { type: "number", default: 0.5, desc: "Center of sharding fraction from 0 to 1" })
8
- .option("shardsize", { type: "number", default: 1, desc: "Size of sharding fraction from 0 to 1 (ex, shardsize = 0.35 and shardcenter = 0.5 results in sharding from 0.15 to 0.85)" })
9
- .option("secondarysize", { type: "number", default: 0, desc: "Also shards this size HOWEVER, any values in this range (which are not matched in shardsize) are delayed." })
10
- .option("filter", { type: "string", default: "", desc: `Filter to only include handle specific function calls (shardsize is still applied). For example, "a&b|c", using regular boolean rules.` })
7
+ .option("fncshard", { type: "string", default: "0-1", desc: "Shard range as start-end (e.g., '0-0.5' or '0.25-0.75')" })
8
+ .option("fncsecshard", { type: "string", default: "", desc: "Secondary shard range as start-end (e.g., '0-0.5'). Values in this range (not matched in fncshard) are delayed." })
9
+ .option("filter", { type: "string", default: "", desc: `Filter to only include handle specific function calls (fncshard is still applied). For example, "a&b|c", using regular boolean rules.` })
11
10
  .argv
12
11
  ;
13
12
 
@@ -47,19 +46,29 @@ async function main() {
47
46
  // (it should be on the same local network as the path value authorities).
48
47
  ClientWatcher.WATCH_STICK_TIME = timeInMinute * 5;
49
48
 
50
- let shardStart = yargObj.shardcenter - yargObj.shardsize / 2;
51
- let shardEnd = yargObj.shardcenter + yargObj.shardsize / 2;
52
- let secondaryStart = yargObj.shardcenter - yargObj.secondarysize / 2;
53
- let secondaryEnd = yargObj.shardcenter + yargObj.secondarysize / 2;
49
+ let [shardStart, shardEnd] = yargObj.fncshard.split("-").map(v => parseFloat(v));
50
+ if (isNaN(shardStart) || isNaN(shardEnd)) {
51
+ throw new Error(`Invalid fncshard format: ${yargObj.fncshard}. Expected format like "0-0.5"`);
52
+ }
54
53
 
55
- console.log(green(`Sharding from ${shardStart} to ${shardEnd}. Fallback sharding (dead function recovery) from ${secondaryStart} to ${secondaryEnd}`));
54
+ let secondaryShardRange: { startFraction: number; endFraction: number } | undefined;
55
+ if (yargObj.fncsecshard) {
56
+ const [secondaryStart, secondaryEnd] = yargObj.fncsecshard.split("-").map(v => parseFloat(v));
57
+ if (isNaN(secondaryStart) || isNaN(secondaryEnd)) {
58
+ throw new Error(`Invalid fncsecshard format: ${yargObj.fncsecshard}. Expected format like "0-0.5"`);
59
+ }
60
+ secondaryShardRange = { startFraction: secondaryStart, endFraction: secondaryEnd };
61
+ console.log(green(`Sharding from ${shardStart} to ${shardEnd}. Fallback sharding (dead function recovery) from ${secondaryStart} to ${secondaryEnd}`));
62
+ } else {
63
+ console.log(green(`Sharding from ${shardStart} to ${shardEnd}`));
64
+ }
56
65
 
57
66
  let filterSelector = parseFilterSelector(yargObj.filter);
58
67
 
59
68
  new PathFunctionRunner({
60
69
  domainName: getDomain(),
61
70
  shardRange: { startFraction: shardStart, endFraction: shardEnd },
62
- secondaryShardRange: yargObj.secondarysize ? { startFraction: secondaryStart, endFraction: secondaryEnd } : undefined,
71
+ secondaryShardRange,
63
72
  // TODO: Maybe abstract this out even more, so anything can plug in permissions checks?
64
73
  PermissionsChecker: PermissionsCheck,
65
74
  filterSelector,
@@ -611,7 +611,7 @@ export function getCallIdOverride(config: {
611
611
  routeKey: def.getKey(...config.args),
612
612
  });
613
613
  } catch (e: any) {
614
- console.warn(`Error getting call id override for ${config.moduleId}.${config.functionId}, falling back to original call id`, { error: e.stack });
614
+ console.error(`Error getting call id override for ${config.moduleId}.${config.functionId}, falling back to original call id`, { error: e.stack });
615
615
  return config.callId;
616
616
  }
617
617
  }
package/tempnotes.txt CHANGED
@@ -1,15 +1,12 @@
1
1
 
2
+ Issue
3
+ - The function sharding doesn't work. I think it's the specific path range not working. And we even get an error saying that we failed to sync.
2
4
 
3
- Local CYOA + Local FunctionRunner works
4
5
 
5
- -1) A lot of API calls are getting locked up and never finishing. We need to fix this. What the fuck is happening? It happens a lot with audio calls, as we make a lot of audio calls, but we can probably replicate it with non-audio calls. I think it happened with some embeddings, although we did create a lot of embeddings, and it only happened at the end. If it's only an audio thing, that's different, but we still need some kind of timeout. But I don't think it's an audio thing, I think it's not actually starting.
6
+ d) Deploy function sharding
7
+ e) Verify by the synced values per server (only on 1 fnc server)
6
8
 
7
9
 
8
- 0) SHARD THE FUNCTION RUNNER!
9
- - And secondary sharding for backup...
10
- - First shard locally
11
- - Test on our sync test page (Otherwise all the writes are going to go to the same function runner anyway, so it's not a good test.
12
-
13
10
  I think even if we run into some occasional issues, we should just power through and try to fix them later. Because I'm sick of working on the framework...
14
11
 
15
12
  MONTHLY SUMMARY!