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
|
@@ -4,10 +4,9 @@
|
|
|
4
4
|
import "../inject";
|
|
5
5
|
import yargs from "yargs";
|
|
6
6
|
let yargObj = yargs(process.argv)
|
|
7
|
-
.option("
|
|
8
|
-
.option("
|
|
9
|
-
.option("
|
|
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.
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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
|
-
|
|
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
|
|
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.
|
|
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
|
-
|
|
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!
|