Compare commits

..
Author SHA1 Message Date
Chris Lu 83efe1547d revert webp support due to "go test"
related to https://github.com/chai2010/webp/issues/9
2017-05-28 10:25:40 -07:00
Chris Lu 48919009fc build with tip 2017-05-28 10:23:10 -07:00
Chris Lu f66fef0ec5 adjust build 2017-05-28 10:10:14 -07:00
Chris Lu 478fe0ecf2 filer add readonly public port 2017-05-27 20:14:22 -07:00
Chris Lu 7ecc0f4b11 rename variables 2017-05-27 18:11:18 -07:00
Chris Lu 021ef0d14b adjust version to 0.76 2017-05-26 23:04:38 -07:00
Chris Lu e3fc676260 add doc for 0.75 2017-05-26 23:01:40 -07:00
Chris Lu 82c3ccc8dd add btree for volume index 2017-05-26 22:51:25 -07:00
Chris Lu 80cefade65 adjust travis 2017-05-25 20:50:56 -07:00
Chris Lu bd97cbc523 skip busy reporting back to master
possible fix for https://github.com/chrislusf/seaweedfs/issues/499
2017-05-23 21:12:03 -07:00
Chris Lu c5f23b26fc add 1.8.1 2017-05-22 23:09:20 -07:00
Chris Lu a7faefd4ce fix compilation error 2017-05-22 23:04:43 -07:00
Chris Lu b3513d3167 skip only readonly volumes
fix https://github.com/chrislusf/seaweedfs/issues/405
2017-05-22 17:05:27 -07:00
Chris Lu 4ce6586710 use local random generator to avoid global lock 2017-05-19 23:33:36 -07:00
Chris Lu 68e2dee2cd Merge pull request #487 from r-m-n/fill_images
Scale images to fit or fill
2017-05-05 22:05:31 -07:00
rmn 366fe0d394 Scale images to fit or fill 2017-05-05 12:17:30 +03:00
Chris Lu 9fcff1bd9a Merge pull request #480 from vitalybaev/webp-resize-support
WebP resize support
2017-04-02 09:02:55 -07:00
Vitaly Baev 7ab9160ee1 WebP resize support 2017-03-31 09:56:00 +03:00
Chris Lu a337b844ec properly send heartbeats
fix https://github.com/chrislusf/seaweedfs/issues/476
2017-03-27 10:11:54 -07:00
Chris Lu e936fe9001 Merge pull request #472 from sparklxb/master
complement weed mount: add read and delete
2017-03-17 09:27:50 -07:00
sparklxb c46e91d229 complement weed mount: add read and delete 2017-03-17 15:02:27 +08:00
Chris Lu 37b79174d1 Merge pull request #469 from sparklxb/master
complement weed mount
2017-03-14 08:21:29 -07:00
Chris Lu b095496d30 Merge pull request #471 from stepanbujnak/master
Show contents of manifest file when cm=false is passed
2017-03-12 22:25:34 -07:00
Stepan Bujnak 14ec3bfc1d Show contents of manifest file when cm=false is passed 2017-03-12 18:40:24 -07:00
Chris Lu 427c7fbf93 Merge pull request #470 from stepanbujnak/master
Added locking on the filer move operation
2017-03-11 20:20:43 -08:00
Stepan Bujnak a72c92e55f Added locking on the filer move operation 2017-03-11 02:52:04 -08:00
sparklxb 3a67b6ddc1 complement weed mount 2017-03-10 14:46:00 +08:00
sparklxb 7f85e15990 complement weed mount 2017-03-10 10:28:19 +08:00
Chris Lu b20cdff82d Merge pull request #463 from sparklxb/master
Fixes #266
2017-03-05 22:46:46 -08:00
sparklxb 813a4f7456 Fixes #266 2017-03-06 13:04:52 +08:00
Chris Lu 470d950918 Merge pull request #461 from sparklxb/master
fix bug: replication, metadata not replicated
2017-03-03 20:02:56 -08:00
sparklxb 4049c72e6c fix bug: replication, metadata not replicated 2017-03-04 11:24:12 +08:00
Chris Lu 30f138a538 fix tests 2017-02-12 22:18:48 -08:00
Chris Lu 41f686ab9d remove weeds.conf 2017-02-12 21:58:44 -08:00
Chris Lu 98d66a569b avoid nil
fix https://github.com/chrislusf/seaweedfs/issues/452
2017-02-11 10:21:28 -08:00
Chris Lu 654173e7c7 Merge pull request #451 from vancepym/patch-2
Update Dockerfile
2017-02-07 09:47:09 -08:00
vancepym 543476cba1 Update Dockerfile
Bump docker base image version to alpine 3.5
2017-02-07 22:50:09 +08:00
Chris Lu 9a8e020559 compile with 1.7 2017-02-06 13:21:28 -08:00
Chris Lu f0d140f164 Merge pull request #448 from vancepym/patch-1
Fix:  the maximum-length character exceed 255
2017-01-23 12:25:07 -08:00
vancepym ee6067e98c Fix: the maximum-length character exceed 255
The length of a CHAR column is fixed to the length that you declare when you create the table. The length can be any value from 0 to 255. When CHAR values are stored, they are right-padded with spaces to the specified length. 

see https://dev.mysql.com/doc/refman/5.7/en/char.html
2017-01-23 20:33:00 +08:00
Chris Lu c2ce97785f set the volume size limit
fixing https://github.com/chrislusf/seaweedfs/issues/447
2017-01-22 21:36:36 -08:00
Chris Lu f302c9fda2 always send the leader info on each heartbeat 2017-01-21 13:58:56 -08:00
Chris Lu 3cb0071025 supporting reading file of size zero 2017-01-21 13:45:16 -08:00
Chris Lu 043b7a7c65 add locking to access l.volumes 2017-01-20 10:18:43 -08:00
Chris Lu bfd2739fce Merge pull request #443 from Jaumo/jaumo
Online mount, unmount + deletion of single volumes
2017-01-20 10:11:33 -08:00
brstgt 0656838fe5 Don't return actual file size from CheckVolumeDataIntegrity, it will be 0 if last needle is a tombstone, so it's not reliable anyway 2017-01-20 16:37:45 +01:00
brstgt 4fb5bb09b6 Remove obsolete property Volume.dataFileSize 2017-01-20 16:31:11 +01:00
brstgt e074a54a20 Delete volumes online without restarting volume server 2017-01-20 13:02:37 +01:00
brstgt 492f93416d Mount and unmount volumes online without restarting volume server 2017-01-20 12:49:20 +01:00
brstgt 18b3afc97a Log volumeId if dataFileSize != actual data file size - improve log types 2017-01-20 12:22:25 +01:00
brstgt 0c898df430 Log volumeId if dataFileSize != actual data file size 2017-01-20 11:52:23 +01:00
Chris Lu c8f54aad8b adjust timing of leader election 2017-01-18 09:54:43 -08:00
Chris Lu 8de0027df5 Release 0.74 2017-01-18 09:39:47 -08:00
Chris Lu 5b0f5f456e volume server get notified of leader change 2017-01-18 09:34:27 -08:00
Chris Lu 59022b6fe0 fix byte counter on loading index file
fix https://github.com/chrislusf/seaweedfs/issues/441
2017-01-18 08:40:39 -08:00
Chris Lu 8b15523c9d Update README.md 2017-01-15 12:39:39 -08:00
Chris Lu e05cc109a6 Update README.md 2017-01-15 12:34:32 -08:00
Chris Lu a55ae8ad52 Update README.md 2017-01-15 12:33:38 -08:00
Chris Lu 76da296799 upgrade to 0.73 2017-01-15 12:29:53 -08:00
Chris Lu 3065506b38 volume servers always connect to the master leader 2017-01-13 10:20:40 -08:00
Chris Lu d953ed442c auto detect volume server ip address 2017-01-12 13:42:53 -08:00
Chris Lu 1be354bdce default IP to "localhost"
so that the master can know the ip address.
2017-01-10 23:57:59 -08:00
Chris Lu adc8d344a5 update proto buffer 2017-01-10 23:57:16 -08:00
Chris Lu e767c3ea4f disable master connection timeout
temporarily disable master connection timeout due to heartbeat
connection timeout
2017-01-10 01:30:00 -08:00
Chris Lu e46c3415f7 gRpc for master~volume heartbeat 2017-01-10 01:01:12 -08:00
Chris Lu 4beaaa0650 simplify the gzip optimization logic
fix https://github.com/chrislusf/seaweedfs/issues/436
2017-01-09 19:31:58 -08:00
Chris Lu 9fa648e570 Merge pull request #435 from sparklxb/master
support uploading files to specific dataCenter
2017-01-09 10:07:07 -08:00
sparklxb 66e7013dfe suport uploading files to specific dataCenter 2017-01-09 23:34:47 +08:00
Chris Lu 07a51815e9 Merge pull request #434 from wangjie/master
fix the bug that we can't get filename when download file.
2017-01-09 00:11:27 -08:00
wangjie 90a6f43c56 fix the bug than we can't get filename when download file. 2017-01-09 14:55:21 +08:00
Chris Lu 53cf1b4900 change the basic unit to MB 2017-01-08 14:57:32 -08:00
Chris Lu ed44f12f6d support Fallocate on linux 2017-01-08 11:01:46 -08:00
Chris Lu 7b6837cbc2 move back the section 2017-01-08 10:35:47 -08:00
Chris Lu b14332df96 Merge pull request #432 from sparklxb/master
support additional header name-value pairs
2017-01-08 10:30:40 -08:00
sparklxb da9b672d1b support additional header name-value pairs 2017-01-08 22:34:42 +08:00
sparklxb 86a7c56275 support additional header name-value pairs 2017-01-08 09:16:40 +08:00
Chris Lu 13e7069eb9 keep track of total data file size 2017-01-06 10:22:20 -08:00
Chris Lu 54dd925283 remove deprecated instructions 2017-01-05 14:53:07 -08:00
Chris Lu 80398a2a3a Merge pull request #430 from vancepym/master
Update Dockerfile
2017-01-05 10:15:09 -08:00
vancepym 4f28876c8d Update Dockerfile
Replace with Alpine Linux based image
2017-01-05 21:52:55 +08:00
Chris Lu e61c9af523 check Accept instead of content type
fix https://github.com/chrislusf/seaweedfs/issues/429
2017-01-04 19:58:27 -08:00
Chris Lu 4d1ac7332e better organized travis 2017-01-04 01:59:26 -08:00
Chris Lu e2100d0626 move links from bintray to github release page 2017-01-04 00:33:22 -08:00
Chris Lu 47b6ce93f8 download from github release page 2017-01-04 00:29:58 -08:00
Chris Lu 0d8cf87a8c remove tab 2017-01-03 22:40:04 -08:00
Chris Lu f9c20aff9d deploy on tags 2017-01-03 22:38:08 -08:00
Chris Lu 83ce8c30fc skip cleanup on travis deployment 2017-01-03 22:36:39 -08:00
Chris Lu 19159ec479 adjust makefile and travis 2017-01-03 22:20:15 -08:00
Chris Lu 9cb034d49e adjust makefile 2017-01-03 22:11:33 -08:00
Chris Lu d1562e48e1 default to release 2017-01-03 22:08:53 -08:00
Chris Lu dc42d15352 release 0.72 2017-01-03 21:32:59 -08:00
Chris Lu 4d3353750e fix build issue 2017-01-03 21:28:30 -08:00
Chris Lu 297f64e286 Merge pull request #428 from sparklxb/master
fix bug: upload big .gz file more than maxMB
2017-01-03 21:23:08 -08:00
Chris Lu 8fb29e5230 change to 0.71 version 2017-01-03 21:17:54 -08:00
Chris Lu 2d13382c68 add releasing configs 2017-01-03 21:14:46 -08:00
lixianbin d96d0a87cf fix bug: upload big .gz file more than maxMB 2017-01-04 11:23:40 +08:00
Chris Lu f7ff98c747 Merge pull request #424 from listeng/master
Return json data when content-type is "application/json"
2016-12-26 02:14:09 -08:00
listeng 5b18cf09e7 Return json data when content-type is "application/json"
Before #344, the filer will return json data, and cschiano make a template that render to html. But sometimes need json data, so I add some code will return json data when content-type is "application/json".
2016-12-26 16:49:43 +08:00
Chris Lu 6b5867ce9d Merge pull request #414 from mtolman/master
Updating PostgreSQL file store integration to support directories.
2016-12-12 20:06:26 -08:00
Mike Tolman 43e655afc8 Updating PostgreSQL file store integration to support directories. 2016-12-12 13:03:32 -07:00
Chris Lu cc34ac0bd5 Merge pull request #411 from mtolman/master
Adding PostgreSQL Filer Support
2016-12-07 17:31:28 -08:00
Mike Tolman e88795be13 Adding PostgreSQL Support 2016-12-07 17:24:40 -07:00
Mike Tolman b18ec59c56 Revert "Adding PostgreSQL Filer Support"
This reverts commit 10853e4d2f.
2016-12-07 17:16:10 -07:00
Mike Tolman 10853e4d2f Adding PostgreSQL Filer Support 2016-12-07 17:13:03 -07:00
Mike Tolman a1783a14cc Revert "Adding PostgreSQL Filer Support"
This reverts commit 855058858a.
2016-12-07 16:54:06 -07:00
Mike Tolman 855058858a Adding PostgreSQL Filer Support 2016-12-07 16:51:36 -07:00
Chris Lu 64509dd6ca fix text. 2016-11-28 20:07:27 -08:00
Chris Lu 924f797c58 Merge pull request #406 from eshujiushiwo/master
Fix the filer connection of cassandra
2016-11-28 20:05:45 -08:00
eshujiushiwo e025fc00a4 let filer use all cassandra server
let filer use all cassandra server
2016-11-28 18:23:39 +08:00
eshujiushiwo 5ee7fdc0cc fix hosts strings
fix hosts strings
2016-11-28 16:03:39 +08:00
eshujiushiwo 3450eff288 fix info log
fix info log
2016-11-28 15:32:16 +08:00
eshujiushiwo 3e29d0f75b Update cassandra_store.go 2016-11-28 15:14:19 +08:00
eshujiushiwo 809aa028ec fix the connection of cassandra
fix the connection of cassandra ,let filer can connect to multi cassandra nodes which are in the one cluster
2016-11-28 15:01:04 +08:00
eshujiushiwo 89ccb6be05 Update cassandra_store.go 2016-11-28 12:16:51 +08:00
eshujiushiwo 5385bf9555 update cassandra connections
update cassandra connections
2016-11-28 11:27:40 +08:00
Chris Lu 9ba52db585 add writable checking
fix https://github.com/chrislusf/seaweedfs/issues/405
2016-11-26 12:14:06 -08:00
Chris Lu dcaf1796fe add option to enable caching 2016-11-16 07:09:57 -08:00
Chris Lu f54f530ada adjust verbose logging 2016-11-13 14:07:51 -08:00
Chris Lu d0cc9a5634 Merge pull request #395 from hxiaodon/master
concurrent loading volume when starting volume server
2016-11-13 00:00:11 -08:00
霍晓栋 b9f385bd66 refactor concurrent loading code logic 2016-11-13 13:24:52 +08:00
霍晓栋 096ffa9744 concurrent loading volume 2016-11-11 11:53:22 +08:00
Chris Lu 3320e495f4 Merge pull request #394 from bedragon/master
fix bug : join post is empty
2016-11-07 19:09:19 -08:00
Yang zhixiang 57005ed7f8 fix bug : join post is empty 2016-11-08 11:00:46 +08:00
Chris Lu 36f9633223 add locks for location.volumes
fix https://github.com/chrislusf/seaweedfs/issues/392
2016-11-06 20:55:22 -08:00
Chris Lu df49692dff add tool to change replication or ttl
fix https://github.com/chrislusf/seaweedfs/issues/386
2016-11-04 20:42:31 -07:00
Chris Lu 05eda424fc Merge pull request #385 from bedragon/master
fix raft_server.go isPeersChanged bug
2016-11-03 10:08:13 -07:00
Yang zhixiang 4194ae33fd fix raft_server.go isPeersChanged bug 2016-11-03 15:46:59 +08:00
Chris Lu 88d0df523e Merge pull request #378 from amincheloh/patch-1
Update Dockerfile and entrypoint.sh
2016-10-12 21:18:51 -07:00
Amin Cheloh 54bd1c406a Update Dockerfile
Move COPY /entrypoint.sh to bottom and make sure entrypoint.sh have execute permission
2016-10-12 17:10:38 +07:00
Amin Cheloh 48a24559a3 Update entrypoint.sh
Running application becomes container's PID 1 allow to receives Unix signals
2016-10-12 16:47:56 +07:00
Chris Lu 79fdea0de4 Merge pull request #375 from hxiaodon/master
supplemental data between compacting and commit compacting
2016-10-08 10:12:50 -07:00
霍晓栋 7d73bbb073 comment UT case 2016-10-07 16:40:51 +08:00
霍晓栋 7d382ba5fe comment UT case 2016-10-07 16:34:22 +08:00
霍晓栋 ce1f7ab662 makediff func with UT case 2016-10-07 16:22:24 +08:00
霍晓栋 ed848425c7 supplemental data between compacting and commit compacting 2016-09-29 13:57:23 +08:00
Chris Lu dffad65f2f fix compilation 2016-09-26 22:30:44 -07:00
Chris Lu 7e29218327 add a template for makeupDiff 2016-09-26 22:26:41 -07:00
Chris Lu 8fa61c28e4 Update README.md 2016-09-23 10:07:06 -07:00
Chris Lu 61550f1b0a Merge pull request #373 from feliperoberto/docker
how to use with docker
2016-09-23 10:02:27 -07:00
Felipe Roberto 0fbec28858 how to use with docker 2016-09-23 13:49:38 -03:00
Chris Lu 1bc041b46d add a new way to manually compact corrupted volume
fix https://github.com/chrislusf/seaweedfs/issues/371
2016-09-22 20:31:20 -07:00
Chris Lu 603f8e4f86 Merge pull request #366 from jze/master
Changed Dockerfile so it uses a special entrypoint script.
2016-09-08 20:50:07 -07:00
Chris Lu 01cbd5cb58 lock
fix https://github.com/chrislusf/seaweedfs/issues/367
2016-09-08 09:50:31 -07:00
Jesper Zedlitz 1c36706306 Changed Dockerfile so it uses a special entrypoint script. All parameters are passed through to weed. Depending on the command the entrypoint.sh script adds parameters to link containers. 2016-09-08 09:19:06 +02:00
Chris Lu 99e47fc5fc Merge pull request #361 from hxiaodon/master
add mysql filer support
2016-09-07 21:07:11 -07:00
霍晓栋 78474409a5 filer mysqlstore bug fix 2016-09-08 11:35:54 +08:00
霍晓栋 1c2affea8e Merge remote-tracking branch 'upstream/master' 2016-09-08 10:34:24 +08:00
Chris Lu 0559aa9673 use Lock instead of RLock
fix https://github.com/chrislusf/seaweedfs/issues/364
2016-09-07 18:21:05 -07:00
Chris Lu c4b7966dbe minor help message change 2016-09-07 18:21:05 -07:00
霍晓栋 3aa021a812 refactoring mysql store code 2016-09-05 14:10:22 +08:00
霍晓栋 e7b237c8da UT case fix 2016-08-31 11:55:02 +08:00
霍晓栋 b0035747e3 add filer support 2016-08-31 11:32:30 +08:00
Chris Lu 9992fe648d Merge pull request #356 from chareice/master
Make Docker build works correctly
2016-08-10 11:07:58 -07:00
ChengLei Shao a3c8235f86 Make Docker build works correctly 2016-08-10 16:11:00 +08:00
Chris Lu fa8198f44b Merge pull request #354 from hxiaodon/master
if replicated volume has one copy in readonly mode at one node,it sho…
2016-08-09 18:03:57 -07:00
霍晓栋 f04d8fcbcc if replicated volume has one copy in readonly mode at one node,it should be removed from writable list 2016-08-09 20:12:39 +08:00
Chris Lu d5b0538f7b Merge pull request #352 from mtolman/master
Adding AutoChunk/MaxMB Support to Filer API
2016-08-05 20:07:45 -07:00
Mike Tolman 01d3f69c52 Adding AutoChunk/MaxMB Support to Filer API
This is related to the following issue I added to chrislusf/seaweedfs:
https://github.com/chrislusf/seaweedfs/issues/342
2016-08-05 16:01:30 -06:00
Mike Tolman a89a3c86d0 Revert "Add AutoChunking to the Filer API, so that you can upload really large files through the filer API."
This reverts commit 09059bfdcc.
2016-08-05 15:47:46 -06:00
Mike Tolman 0d331c1e3a Revert "Changing needle_byte_cache so that it doesn't grow so big when larger files are added."
This reverts commit 87fee21ef5.
2016-08-05 15:46:45 -06:00
Mike Tolman 0f4c7dd8fd Revert "Ooops. Missed a line."
This reverts commit 14d4252904.
2016-08-05 15:46:08 -06:00
Mike Tolman ce99bb927d Revert "Adding HTTP verb whitelisting options."
This reverts commit 34837afc7a.
2016-08-05 15:45:48 -06:00
Mike Tolman 34837afc7a Adding HTTP verb whitelisting options. 2016-08-05 15:23:43 -06:00
Mike Tolman 14d4252904 Ooops. Missed a line. 2016-08-05 15:22:46 -06:00
Mike Tolman 6d12230021 Merge branch 'master' of https://github.com/mtolman/seaweedfs 2016-08-05 15:19:55 -06:00
Mike Tolman 09059bfdcc Add AutoChunking to the Filer API, so that you can upload really large files through the filer API. 2016-08-05 15:19:10 -06:00
Mike Tolman b6ce40e87f Add AutoChunking to the Filer API, so that you can upload really large files through the filer API. 2016-08-05 15:16:17 -06:00
Mike Tolman 87fee21ef5 Changing needle_byte_cache so that it doesn't grow so big when larger files are added. 2016-08-05 15:14:24 -06:00
Chris Lu 761ef1c73e Merge pull request #347 from hxiaodon/master
deleted needle does not need checksum verification(patch)
2016-07-25 10:50:23 -07:00
霍晓栋 52e55508da deleted index entry could not point to deleted needle 2016-07-25 15:07:11 +08:00
霍晓栋 b9b3651a98 deleted index entry could not point to deleted needle 2016-07-25 14:56:58 +08:00
霍晓栋 09bd3d015d deleted index entry could not point to deleted needle 2016-07-25 14:54:40 +08:00
Chris Lu 0ba3f47e31 Merge pull request #346 from hxiaodon/master
deleted needle does not need checksum verification
2016-07-24 22:23:13 -07:00
霍晓栋 78678f4bcb deleted needle does not need checksum verification 2016-07-25 11:40:35 +08:00
Chris Lu 185a916f5e adjusting command options 2016-07-21 15:00:07 -07:00
Chris Lu a5be4a6d40 fix package name 2016-07-21 01:23:56 -07:00
Chris Lu a57162e8bf delete operation does not need this checking 2016-07-21 00:40:13 -07:00
Chris Lu cdae9fc680 add "weed copy" command to copy files to filer 2016-07-20 23:45:55 -07:00
Chris Lu 40ba6d2a6f Merge pull request #345 from hxiaodon/master
recover filer read handler logic
2016-07-20 21:28:22 -07:00
霍晓栋 574cc41f0b recover filer read handler logic 2016-07-21 12:20:22 +08:00
Chris Lu dd84637c34 Merge pull request #344 from cschiano/master
Add a visualization for the filer
2016-07-20 07:48:13 -07:00
cschiano af905a3ff7 Add limit parameter and pagination for files 2016-07-20 10:46:28 +02:00
cschiano c63cebaee1 Add a visualization for the filer 2016-07-18 10:28:24 +02:00
Chris Lu d3ae3a8e14 collect proof when stopping 2016-07-05 10:23:14 -07:00
Chris Lu b38ff39e8b add master profiling option 2016-07-03 15:39:57 -07:00
Chris Lu d981eb282f refactor volume_read_write.go out of volume.go 2016-07-03 00:10:27 -07:00
Chris Lu 576573711a refactoring 2016-07-02 23:58:23 -07:00
Chris Lu 3d8df0f709 refactor volume_loading.go out of volume.go 2016-07-02 23:56:49 -07:00
Chris Lu 582d5d526c refactoring 2016-07-02 23:50:58 -07:00
Chris Lu 3713119ab9 adjust verification logic.
1. log file name for easier debugging
2. remove unused version in readIndexEntryAtOffset()
3. if indexSize==0, the dataFile usually still has a super block of
size 8. So skipping this case.
2016-07-02 23:45:37 -07:00
Chris Lu 2fa2235fe3 Merge pull request #338 from hxiaodon/master
add index,dat file's integrity checking
2016-07-02 23:29:17 -07:00
霍晓栋 c527d85d97 refactor data integrity checking code v3 2016-07-03 14:13:43 +08:00
霍晓栋 16f6984d02 refactor data integrity checking code v2 2016-07-03 14:11:25 +08:00
霍晓栋 dda13def2a refactor data integrity checking code 2016-07-03 12:53:03 +08:00
霍晓栋 3018443cd7 code change for fix_dat.go 2016-07-02 21:37:14 +08:00
霍晓栋 2e74fb60c8 add data integrity checking 2016-07-02 21:34:30 +08:00
Chris Lu 8dfe22ef1c Merge pull request #335 from hxiaodon/master
fix bug when choosing the healthy master in filer service
2016-06-30 08:03:35 -07:00
霍晓栋 339856eb78 fix bug when choosing the healthy master in filer service 2016-06-30 19:54:05 +08:00
Chris Lu 5771225f54 Merge pull request #333 from hxiaodon/master
fix volume_layout bug, add new feature for volume etag write,filer pa…
2016-06-29 01:48:30 -07:00
霍晓栋 079fdbad13 fix volume_layout bug, add new feature for volume etag write,filer pass through query params' 2016-06-29 16:05:00 +08:00
Chris Lu b617b13c43 remember oversized volumes
fix https://github.com/chrislusf/seaweedfs/issues/331
2016-06-27 15:28:23 -07:00
Chris Lu d0dbf6d2ea adjust logging 2016-06-26 12:49:10 -07:00
Chris Lu b6de5f00b3 Merge pull request #329 from hxiaodon/master
refactor Assign func to accept main[dataCenter|rack|dataNode] params if needed
2016-06-25 22:53:38 -07:00
霍晓栋 1f63094542 refactor Volume Assign function 2016-06-26 10:50:18 +08:00
霍晓栋 c601ef03b1 Merge remote-tracking branch 'upstream/master' 2016-06-26 10:27:50 +08:00
Chris Lu 0647c75a06 update dependency versions 2016-06-24 14:20:32 -07:00
Chris Lu 101e784577 add locking on possible concurrent map access
fix https://github.com/chrislusf/seaweedfs/issues/328
2016-06-23 09:10:25 -07:00
霍晓栋 79b0a58132 add options params for the Assign func 2016-06-23 11:19:09 +08:00
Chris Lu 356b8048c5 fix compilation problem due to API changes 2016-06-18 18:57:33 -07:00
Chris Lu 18cf59c375 Merge pull request #323 from ham1/tidy-up
Added LICENSE file and updated README.md
2016-06-18 18:12:26 -07:00
Graham Russell fe8dc26849 Added LICENSE file and updated README.md 2016-06-18 23:11:09 +01:00
Chris Lu cc01c352c3 refactoring 2016-06-13 15:07:17 -07:00
Chris Lu a61453d3ec fix nil crash
fix https://github.com/chrislusf/seaweedfs/issues/320
2016-06-13 14:38:35 -07:00
Chris Lu f6d75476b9 Merge pull request #315 from 030io/master
fix bug: filer DELETE
2016-06-10 10:53:55 -07:00
DaLin fa2a7b5f2f fix bug: filer DELETE 2016-06-11 01:16:19 +08:00
Chris Lu e416679cea Merge pull request #314 from hxiaodon/master
made a little change for Amazon S3 API's compatibility(v2)
2016-06-08 11:38:57 -07:00
霍晓栋 3a25af223f refactor work for filer write handler 2016-06-08 15:46:14 +08:00
霍晓栋 26bb9094d4 made a little change for Amazon S3 API's compatibility 2016-06-08 12:30:20 +08:00
Chris Lu 0e3140c54c a little refactoring 2016-06-06 23:50:27 -07:00
Chris Lu 04380d6a36 Merge pull request #312 from hxiaodon/master
filer server concern the lead change
2016-06-06 23:44:02 -07:00
霍晓栋 d514b6f3f9 read write handler update 2016-06-07 11:45:00 +08:00
霍晓栋 1ef81ac518 filer could detect master nodes healthy status and choose a working one when encountering SPOF 2016-06-07 11:38:40 +08:00
Chris Lu e20ef8a077 add tool to change a volume's replication
fix https://github.com/chrislusf/seaweedfs/issues/29
2016-06-06 12:27:28 -07:00
Chris Lu bb839ba268 fix 2016-06-05 10:57:14 -07:00
Chris Lu 96d2f11f81 adjust log 2016-06-05 09:05:03 -07:00
Chris Lu b456173eb8 delete file storage when POST to update
PUT is used to update. But sometimes POST is also used to post the same
file again. In this case, the actual file storage was not marked as
deleted.

This fix will try its best to delete the orphan files.
2016-06-03 00:24:55 -07:00
Chris Lu 535b1610c8 add fid and url to filer post result
fix https://github.com/chrislusf/seaweedfs/issues/274
2016-06-02 20:44:50 -07:00
Chris Lu 4f47b8cff9 refactoring 2016-06-02 20:05:34 -07:00
Chris Lu a6e948840d fix path 2016-06-02 18:15:54 -07:00
Chris Lu 5ce6bbf076 directory structure change to work with glide
glide has its own requirements. My previous workaround caused me some
code checkin errors. Need to fix this.
2016-06-02 18:09:14 -07:00
Chris Lu caeffa3998 add missing unlock()!!!!! 2016-06-02 11:06:05 -07:00
Chris Lu 6df18a9181 rwlock concurrent read map 2016-05-30 12:30:26 -07:00
Chris Lu 46a89a7d61 fix concurrent write map
fix https://github.com/chrislusf/seaweedfs/issues/311
2016-05-27 08:13:43 -07:00
Chris Lu 59017da4f2 add missing parameters.
strange git errors happen twice since adding glide.
2016-05-26 08:37:27 -07:00
Chris Lu 45a12505f2 bind ip address when starting filer
fix https://github.com/chrislusf/seaweedfs/issues/290
2016-05-25 08:22:31 -07:00
Chris Lu 8e67c4f597 clean up old config only when peers are changed.
fix https://github.com/chrislusf/seaweedfs/issues/307
2016-05-24 10:45:28 -07:00
Chris Lu c24c1ffd1a skip vendor folder 2016-05-23 14:28:38 -07:00
Chris Lu 9d7868ee4e add glide to manage dependency
fix https://github.com/chrislusf/seaweedfs/issues/256
2016-05-23 14:27:39 -07:00
Chris Lu dfde029430 Merge pull request #306 from hankya/master
master: redirect handler accept collection parameter
2016-05-23 10:13:01 -07:00
yangrun db1ac7b3eb master: redirect handler accept collection parameter 2016-05-23 18:21:38 +08:00
Chris Lu 4734efa9a1 lock node.children 2016-05-19 23:57:31 -07:00
Chris Lu 57c85adc53 lock dn.volumes 2016-05-19 23:32:56 -07:00
Chris Lu f8b03c45ef properly release memory
fix https://github.com/chrislusf/seaweedfs/issues/301
2016-05-13 00:19:59 -07:00
Chris Lu e639f1f889 Merge pull request #302 from alexanderk23/fix_content_disposition_header
Fix Content-Disposition header
2016-05-12 10:05:50 -07:00
Alexander Kovalenko f101ad6855 Fix Content-Disposition header; add dl=(0|1) URI param to use inline (default) or attachment 2016-05-12 13:11:27 +03:00
Chris Lu 766512c475 close current needle map when switching 2016-05-09 10:04:21 -07:00
Chris Lu 3626ec5cf7 do not forget to vacuum if cluster changes 2016-05-09 09:58:06 -07:00
Chris Lu e8193ec201 return nil if no error
fix https://github.com/chrislusf/seaweedfs/issues/299
2016-05-05 10:37:33 -07:00
Chris Lu 596f58507e fix refactoring error 2016-04-28 09:29:21 -07:00
Chris Lu 442e798985 use detailed map of errors for distributed operations 2016-04-28 09:11:01 -07:00
Chris Lu 1d86ac8761 just refactoring 2016-04-26 20:45:35 -07:00
Chris Lu c9e33d3709 separate into 2 files, no logic change 2016-04-26 20:10:26 -07:00
chrislusf adcfaa5735 correct cache: fix racing condition 2016-04-17 12:03:45 -07:00
chrislusf 6dd257a81f adjust to real case cache size 2016-04-15 12:06:43 -07:00
chrislusf b03e7b26b5 add []byte caching and pooling
fixes https://github.com/chrislusf/seaweedfs/issues/211
2016-04-15 11:56:53 -07:00
chrislusf 3fb98a904b fmt 2016-04-15 11:04:39 -07:00
chrislusf 74b045e9b6 improve performance a little bit when having white list 2016-04-14 14:42:19 -07:00
Chris Lu 6e21aeea59 Merge pull request #291 from vitalybaev/favicon
Added /favicon.ico handler
2016-04-14 09:06:35 -07:00
Vitaly Baev d1fd372eb2 Added /favicon.ico handler 2016-04-14 11:46:16 +03:00
chrislusf f91baa4b4b mark it as 0.71beta 2016-04-14 01:31:03 -07:00
chrislusf 0649d778a7 pooling []byte
reduce the number of requests to make([]byte)
2016-04-14 01:30:26 -07:00
chrislusf 95e0d2f1b2 make VolumeLayout thread safe 2016-04-14 01:28:40 -07:00
Chris Lu 1b41b8682b remove test image 2016-04-11 23:48:21 -07:00
Chris Lu 274230dbcb releasing 0.70 2016-04-11 23:38:38 -07:00
Chris Lu 6c5eddaf1d Merge pull request #288 from bluefoxah/master
[MOD] fix a bug.if node is nil will get an panic.
2016-04-11 07:43:20 -07:00
张远浩 7a7f4cecbb [MOD] fix a bug.if node is nil will get an panic. 2016-04-11 18:17:22 +08:00
Chris Lu b873b856f2 Merge pull request #287 from bluefoxah/master
modify the lock
2016-04-11 01:11:49 -07:00
bluefoxah c67aee7012 modify the lock
It seems that we did not use the feture of rwlock now.
delete the sync.Mutex only use sync.RWMutex.
2016-04-11 15:53:59 +08:00
chrislusf 112e2c6922 clearer error message 2016-04-10 01:50:58 -07:00
Chris Lu 62f9ce180d Merge pull request #286 from thinxer/parseKeyHash
faster ParseKeyHash
2016-04-10 01:42:17 -07:00
Jianfei Wang eec72b5136 storage: faster ParseKeyHash 2016-04-10 15:54:40 +08:00
Jianfei Wang 5364b3d8f5 storage: add test for ParseKeyHash 2016-04-10 15:52:18 +08:00
chrislusf b39c384d6d Revert "Merge pull request #284 from thinxer/binary"
This reverts commit 3523ad5239, reversing
changes made to 5d100994b1.
2016-04-10 00:24:22 -07:00
Chris Lu 113392bce8 Merge pull request #285 from thinxer/needle-mutex
storage: do not copy sync.Mutex by value
2016-04-09 23:57:18 -07:00
Jianfei Wang a192373c25 storage: do not copy sync.Mutex by value 2016-04-10 13:47:03 +08:00
Chris Lu 3523ad5239 Merge pull request #284 from thinxer/binary
replace util/bytes.go with binary.BigEndian (again)
2016-04-09 01:16:13 -07:00
Jianfei Wang 18254d9aae replace util/bytes.go with binary.BigEndian 2016-04-09 14:38:01 +08:00
Jianfei Wang f0cc264757 storage: add test for ParseKeyHash 2016-04-09 11:33:06 +08:00
chrislusf 5d100994b1 Revert "Merge pull request #281 from thinxer/binary"
This reverts commit a87fe8ffce, reversing
changes made to 6876bfa685.
2016-04-08 15:52:03 -07:00
Chris Lu a87fe8ffce Merge pull request #281 from thinxer/binary
replace util/bytes.go with binary.BigEndian
2016-04-06 07:08:55 -07:00
Jianfei Wang 7bc10d46e3 replace util/bytes.go with binary.BigEndian 2016-04-06 17:08:52 +08:00
chrislusf 6876bfa685 avoid same directory with different dir ids
fix https://github.com/chrislusf/seaweedfs/issues/277
2016-04-04 16:32:18 -07:00
Chris Lu 7dcbbaa653 Merge pull request #276 from ernado/master
use klauspost/crc32 instead of hash/crc32
2016-04-01 12:35:44 -07:00
Alexandr Razumov a2bb5a34fd update .travis.yml 2016-04-01 22:23:37 +03:00
Alexandr Razumov ca2a6cc36b use klauspost/crc32 instead of hash/crc32 2016-04-01 22:18:58 +03:00
chrislusf 67cd8959bc fix tests 2016-03-30 12:53:37 -07:00
chrislusf c359a5117f add lock to dir children map
fix https://github.com/chrislusf/seaweedfs/issues/273
2016-03-30 12:34:14 -07:00
Chris Lu cc4d475519 Update README.md 2016-03-16 23:22:43 -07:00
chrislusf 62074c7653 adjust reading ip address
adjust reading ip address
2016-03-08 08:46:46 -08:00
chrislusf 4c8367a8b3 add redis password
fix https://github.com/chrislusf/seaweedfs/issues/263
2016-03-08 08:46:28 -08:00
Chris Lu f7f9129b05 Merge pull request #259 from tnextday/master
Fix chunk manifest replicate upload error
2016-02-27 09:12:45 -08:00
tnextday a98f359122 Fix chunk manifest replicate upload error
Escape the redirect url in volume read handler
2016-02-27 17:42:41 +08:00
Chris Lu a436b0345a Merge pull request #239 from hxiaodon/master
dereplicate filer post request & support filer get req with raw fileId
2016-01-17 21:29:36 -08:00
Xiaodong Huo 61b1d73f5a Update filer_server_handlers.go
filer service PUT method update file while POST method create file
2016-01-17 12:30:23 +08:00
霍晓栋 7cf64ae07a dereplicate filer post request & support filer get request with raw fileId 2016-01-13 16:58:07 +08:00
Chris Lu 40f7c5d286 Merge pull request #236 from hxiaodon/master
collection name could be specified in url
2016-01-04 15:15:37 -08:00
Xiaodong Huo 166cc0d48a collection name could be specified in url
uploading file with filer service could specify the collection name in get/post field, if no collection specified, the default collection setting against the filer service will be used
2016-01-04 09:52:32 +08:00
chrislusf 6c88abf62f adjust print out when error 2015-12-30 22:48:19 -08:00
Chris Lu 963c36338a Merge pull request #233 from hxiaodon/master
Update store_replicate.go
2015-12-30 22:44:05 -08:00
hxiaodon 4e48f64512 Update store_replicate.go
replication operations should be equal to volume's replication setting
2015-12-28 14:23:26 +08:00
Chris Lu 4d56039ad4 Merge pull request #229 from Mohanson/patch-2
fix bug : master cann't redirect urlquery string
2015-12-25 00:56:05 -08:00
Chris Lu 9210bf4be1 Merge pull request #228 from Mohanson/patch-1
add Introductions of scale of image
2015-12-25 00:54:24 -08:00
Mohanson 3c9ef6245e fix bug : master cann't redirect urlquery string
There is a bug that master can not redirect urlquery to slave volumn.
so i fix it, and it run good now.
2015-12-25 16:32:50 +08:00
Mohanson 688b99eb73 add Introductions of scale of image 2015-12-25 14:47:33 +08:00
chrislusf 7ae7029154 adjust usage text to fit the display 2015-12-14 22:52:52 -08:00
chrislusf e921cb1a9d format changes 2015-12-14 22:38:58 -08:00
Chris Lu df5e54e02a Merge pull request #224 from tnextday/feature/chunked-file-support
Feature/chunked file support
2015-12-14 21:42:38 -08:00
tnextday 031d26527f update 2015-12-15 13:08:09 +08:00
tnextday 521be17a9e verbose log 2015-12-15 13:05:59 +08:00
tnextday f925374db6 Move write response content into a function 2015-12-15 11:26:16 +08:00
tnextday 90d410d627 verbose log 2015-12-15 00:30:18 +08:00
tnextday b177afc326 weed download command use stream download the large file. 2015-12-15 00:14:02 +08:00
tnextday aa44028b46 update 2015-12-14 22:14:57 +08:00
tnextday f240c57f16 Rename ChunkManifest.GetData to ChunkManifest.Marshal 2015-12-14 22:01:30 +08:00
tnextday 82e6d67ccc update 2015-12-03 21:35:33 +08:00
tnextday 4fda5f8bfd update 2015-12-03 18:21:58 +08:00
tnextday daac5de1ba more check in http_util.Delete
add status code in `DeleteResult` struct
operation.DeleteFiles maybe unsafe, so `ChunkManifest.DeleteChunks` manually delete each chunks
2015-12-03 16:27:02 +08:00
tnextday a9a336fdff delete file return needle size 2015-12-02 21:45:26 +08:00
tnextday 34963de458 returen chunks file size when delete a chunkmanifest 2015-12-02 21:35:50 +08:00
tnextday 662915e691 Delete all chunks when delete a ChunkManifest
LoadChunkManifest can uncompress buffer
move compress.go from storage to operation because of import cycle
MakeFile add cross complete command
2015-12-02 21:27:29 +08:00
tnextday 520875d455 update 2015-12-02 18:25:18 +08:00
tnextday d0e2475ece FilePart.Upload use base name instead of full path
fix chunked file download error
2015-12-02 16:35:16 +08:00
tnextday 2c0a7fe75e complete submit chunked file 2015-12-02 15:00:46 +08:00
tnextday de5e07ce3e rename FlagChunkedFile to FlagChunkManifest 2015-12-01 20:53:44 +08:00
tnextday 6b0894d806 update ChunkedFile to seekable reader, so we can use io.* to read data 2015-12-01 20:23:50 +08:00
tnextday f825d23789 fix build error 2015-11-30 00:21:42 +08:00
tnextday 1817864a45 add chunk file helper to support large file 2015-11-29 23:49:41 +08:00
tnextday a4f64c0116 edit git ignore 2015-11-26 23:30:08 +08:00
chrislusf 020dd480ed fix 2015-11-22 10:11:25 -08:00
chrislusf 70d050416b fix
set HTTP_X_FORWARDED_FOR when proxying

https://github.com/chrislusf/seaweedfs/issues/214
2015-11-22 09:31:43 -08:00
Chris Lu dcb8215482 Merge pull request #221 from euforia/master
Added basic makefile
2015-11-17 18:42:06 -08:00
euforia 94757a209b Added basic makefile 2015-11-17 18:03:23 -08:00
chrislusf 805740069a go fmt 2015-10-19 22:03:18 -07:00
chrislusf faaf44f171 following travis instructions to move to new architecture 2015-10-19 01:07:48 -07:00
chrislusf 6983277042 test with go 1.5, skipping 1.3 and 1.4 2015-10-19 01:05:35 -07:00
chrislusf 2395ee9b2e Merge pull request #210 from maggot611/deamon_exit
[bug fix]weed daemon exit due to hangup signal when terminal close
2015-10-19 01:01:24 -07:00
tianshimao 3c48d871d1 [bug fix]weed daemon exit due to hangup signal when terminal close 2015-10-19 14:39:11 +08:00
chrislusf 5feae4f74c enable collection deletion 2015-10-17 09:02:59 -07:00
chrislusf 2dcdd121ec Merge pull request #202 from elcct/server_filer_fix
server_filer_fix
2015-09-27 12:06:48 -07:00
Pawel Szymanski bbcde8a19d server_filer_fix 2015-09-27 16:00:23 +01:00
chrislusf 1e78b8bc28 Merge pull request #187 from skx/master
Allow whitelisting by CIDR range, not just literally.
2015-09-05 00:09:30 -07:00
Steve Kemp 2a777a970c Allow whitelisting by CIDR range, not just literally.
This allows you to write something like this:

         /usr/local/bin/weed master -mdir /srv/weed/master -whiteList=192.168.0.0/24,127.0.0.1

This will whitelist all the 192.168.0.XX hosts, as well as localhost.
2015-09-05 10:00:13 +03:00
chrislusf 91db227b27 avoid using empty fileId to delete
fix https://github.com/chrislusf/seaweedfs/issues/183
2015-08-21 14:09:36 -07:00
chrislusf 1c6729d4c1 Merge pull request #178 from seifer/underlining.in.collection.name
fix extract collection name from .dat file
2015-08-18 10:19:11 -07:00
Timur Nurutdinov 4b0904e9c4 fix extract collection name from .dat file 2015-08-18 19:58:45 +03:00
chrislusf 7d1e9a6b8a add option to redirect moved or non-local volumes
fix https://github.com/chrislusf/seaweedfs/issues/168
2015-08-03 14:43:15 -07:00
chrislusf 320e946d50 fix ttl change detection
https://github.com/chrislusf/seaweedfs/issues/166
2015-07-17 19:30:25 -07:00
chrislusf c4897df09c Revert "adjust symlink"
This reverts commit 8b1f83a0ed.
2015-07-13 11:13:47 -07:00
chrislusf 8b1f83a0ed adjust symlink
as recommended in https://github.com/chrislusf/seaweedfs/issues/160
2015-07-12 21:50:44 -07:00
chrislusf 430f371a97 fix wrong logic 2015-07-11 12:20:39 -07:00
chrislusf 9b8f8f4bb9 add logging 2015-07-11 12:20:09 -07:00
chrislusf d8bb3845ae fix glog format 2015-07-11 09:55:45 -07:00
Chris Lu 9bf10975bd Merge branch 'master' of github.com:chrislusf/weed-fs 2015-07-11 01:07:12 -07:00
Chris Lu a6aa79aab2 merge with latest glog 2015-07-11 01:06:58 -07:00
chrislusf 2c595d2d16 skip isFileUnchanged checking since ttl always change
skip checking since ttl always change. Fixing
https://github.com/chrislusf/seaweedfs/issues/166
2015-07-10 09:43:49 -07:00
chrislusf a4d3f2da3d Avoid nil case when fixing data 2015-07-08 23:21:56 -07:00
chrislusf 3476d31e50 Add Ext format when exporting files. 2015-07-08 23:21:56 -07:00
chrislusf 8d10b91cf3 Update README.md 2015-07-08 02:05:11 -07:00
chrislusf 95855da282 Adjust for window path
fix https://github.com/chrislusf/seaweedfs/issues/161
2015-07-08 01:43:26 -07:00
chrislusf 3b2645979d Use request host info for master url if possible
Fix https://github.com/chrislusf/seaweedfs/issues/148
2015-06-24 09:50:41 -07:00
chrislusf 418878edce In case lastNode==0, need to set it to -1
Fix https://github.com/chrislusf/seaweedfs/issues/156
2015-06-23 22:49:09 -07:00
chrislusf 30242409f4 allowing proxy to leader for volume id lookup then redirect to volume server
Fix https://github.com/chrislusf/seaweedfs/issues/154
2015-06-22 11:41:51 -07:00
chrislusf fd2e6bcf5d Easier variable names 2015-06-02 00:33:13 -07:00
chrislusf 26cdd11d8f Fix compilation error!!! 2015-06-02 00:23:41 -07:00
chrislusf 51aac49e82 each command use its own options to avoid parameter collision
fix https://github.com/chrislusf/seaweedfs/issues/152
2015-06-01 19:25:01 -07:00
chrislusf e09f45f5ed Fix compilation error.
Fix for https://github.com/chrislusf/seaweedfs/issues/150
2015-05-30 13:28:39 -07:00
chrislusf 32ba7fc6c0 Fix a possible index out of range error. Remove unnecessary caching. 2015-05-26 10:29:49 -07:00
chrislusf 86cd40fba8 Add "weed backup" command.
This is a pre-cursor for asynchronous replication.
2015-05-26 00:58:41 -07:00
chrislusf 7272af8ec4 Adjust dir parameter default value. 2015-05-25 23:53:45 -07:00
chrislusf c86ae76e02 Remove old file 2015-05-25 23:51:41 -07:00
chrislusf c89b4fd18b Add ParseUint64 function 2015-05-25 23:51:12 -07:00
chrislusf 36a31771f1 Add Key String() function 2015-05-25 23:50:19 -07:00
chrislusf 8f88d382a5 Rename variables 2015-05-23 10:16:01 -07:00
chrislusf d3d23e779a Adjust log message 2015-05-23 10:15:16 -07:00
chrislusf 3afa3bea73 Adjust log message 2015-05-23 10:14:18 -07:00
chrislusf 85bfab612c Add comments 2015-05-23 10:13:26 -07:00
chrislusf dc2c1aedcc Merge branch 'master' of https://github.com/chrislusf/seaweedfs 2015-05-22 09:13:10 -07:00
chrislusf c7cf4fa46c Fix looking for master nodes. 2015-05-22 08:12:51 -07:00
chrislusf ebf8e9f663 Merge pull request #145 from dyeldandi/incrementalExport
Using LastModified in export to export only new files and fill up ctime and mtime in tar archive
2015-05-20 09:38:52 -07:00
Denis Yeldandi 4e1c30b60a Added -newer argument, which takes a date/time in RFC3339 format and
exports only files newer than this time
2015-05-20 15:11:12 +03:00
chrislusf 99aee22e08 Adjust admin url pattern 2015-05-17 13:19:43 -07:00
chrislusf 5646ca9458 Merge pull request #142 from yanyiwu/master
if mt != "application/octet-stream"
2015-05-16 19:43:14 -07:00
yanyiwu 96b73e3e94 if mt != "application/octet-stream"
became
if !strings.HasPrefix(mt, "application/octet-stream")

In our situation,
    mt can be 'application/octet-stream;charset=ISO-8859-1',
    so I think HasPrefix will be more accurate.
2015-05-16 18:55:58 +08:00
chrislusf 3188382ea7 More debug information for connecting to master 2015-05-14 21:46:59 -07:00
chrislusf b8314fb054 Textual changes. 2015-05-08 23:44:11 -07:00
chrislusf 66317b8438 Increase compact revision during each compaction 2015-05-08 23:43:59 -07:00
chrislusf dac3b592ed Add compact revision in volume super block 2015-05-08 23:34:14 -07:00
chrislusf 98d4adbb8a Merge pull request #138 from carmark/master
modify the dockerfile to make sure it was built successfully
2015-05-07 05:11:32 -07:00
Lei Xue e9790c030e modify the dockerfile to make sure it was built successfully 2015-05-07 15:33:33 +08:00
chrislusf 49b1ba5bbf break away from code.google.com 2015-05-03 12:37:49 -07:00
chrislusf 8660ecc7ec Merge pull request #135 from blalab/master
Some orthographic suggestions
2015-05-03 09:30:14 -07:00
Ricardo Cid 50b909e537 Some orthographic suggestions 2015-05-02 06:15:25 -04:00
chrislusf 5c760523be Merge pull request #128 from yanyiwu/master
[ui] Ordered VolumeInfos is more Human-readable
2015-04-20 10:56:24 -07:00
yanyiwu dc47db5512 unittest: TestSortVolumeInfos 2015-04-21 01:22:13 +08:00
yanyiwu b7a18580b8 Sort VolumeInfos by VolumeId in Store.Status();
Ordered VolumeInfos is more Human-readable,
especially when there is a lot of volumes.
2015-04-21 01:21:21 +08:00
chrislusf c42d33e800 Merge pull request #127 from yanyiwu/master
BUG FIXED and IMPROVEMENT
2015-04-20 07:42:21 -07:00
yanyiwu eaad4fa3c4 BUG FIXED: RoundRobinCounter.Add will cause a out of range crash
when index >= len(rrc.Values)
2015-04-20 22:05:20 +08:00
yanyiwu c65b9588e2 [ui] BUG FIXED: Concurrent Connections incorrect. 2015-04-20 21:50:07 +08:00
yanyiwu 9cd221cc33 More readable peers usage:
other master nodes in comma separated ip:port list, example:
127.0.0.1:9333,127.0.0.1:9334

Add example to prompt ip:port list is split by ','
2015-04-20 14:47:41 +08:00
chrislusf 5c81fa1075 Prepend prefix "0" for odd number of hex characters. 2015-04-19 18:54:05 -07:00
chrislusf d47a6701c6 Merge pull request #126 from yanyiwu/master
FIXED: When RaftServer cannot find a leader, Return a more readable erro...
2015-04-19 07:05:54 -07:00
yanyiwu 6f96862662 FIXED: When RaftServer cannot find a leader, Return a more readable error.
Before:
curl -F "file=1234" "http://127.0.0.1:9333/submit"
{"error":"Post http:///dir/assign: http: no Host in request URL"}
After:
curl -F "file=1234" "http://127.0.0.1:9333/submit"
{"error":"Raft Server not initialized!"}
2015-04-19 19:07:06 +08:00
chrislusf 6e876e0582 Merge pull request #125 from yanyiwu/master
[ui] seaweedfs logo and icon
2015-04-17 12:29:59 -07:00
yanyiwu 3f253a587c [ui] seaweedfs logo and icon 2015-04-18 02:26:27 +08:00
chrislusf 382441f9ff Update README.md 2015-04-16 17:19:51 -07:00
chrislusf 71dfecd96d Update README.md 2015-04-16 17:18:14 -07:00
chrislusf 283138eb86 Update README.md 2015-04-16 17:15:53 -07:00
chrislusf ea37a8ca64 Merge pull request #122 from stuartpb/seaweedfs-unify
Fix a couple more weedfs -> SeaweedFS instances
2015-04-16 15:44:18 -07:00
Stuart P. Bentley 86e80aa9a0 Fix a couple more weedfs -> SeaweedFS instances
Apparently I forgot to save these files before submitting #121
2015-04-16 21:46:37 +00:00
chrislusf d09475d23b Update Dockerfile 2015-04-16 14:29:45 -07:00
chrislusf df17271f05 Update README.md 2015-04-16 14:28:08 -07:00
chrislusf b9e8b5a816 Merge pull request #121 from stuartpb/seaweedfs-unify
More consistency with SeaweedFS name
2015-04-16 14:18:17 -07:00
Stuart P. Bentley 1a194a578c More consistency with SeaweedFS name
Among the changes, this replaces a couple instances of "Seaweed File System"
with "SeaweedFS", for the same reason that nobody says "Mongo Data Base".
2015-04-16 21:11:25 +00:00
chrislusf d960e94290 Update README.md 2015-04-16 14:02:38 -07:00
chrislusf 08c41fc7e7 Update README.md 2015-04-16 14:01:47 -07:00
chrislusf 51432ac724 Update .project 2015-04-16 13:52:13 -07:00
chrislusf ba84350e58 Update README.md 2015-04-16 13:47:54 -07:00
chrislusf bf32977dcb Update README.md 2015-04-16 13:44:08 -07:00
chrislusf e736963f3c Merge pull request #119 from stuartpb/fix-namesapce
Fix flat_namespace_filer.go implementing "FlatNamesapceFiler"
2015-04-16 13:27:13 -07:00
chrislusf 4d1ccf3e10 Merge pull request #118 from stuartpb/seaweedfs-rename
Change all chrislusf/weed-fs links to point to chrislu/seaweedfs
2015-04-16 13:21:55 -07:00
Stuart P. Bentley 03d99503bb Fix flat_namespace_filer.go implementing "FlatNamesapceFiler" 2015-04-16 20:18:34 +00:00
Stuart P. Bentley f0c2a2dcb3 Change all chrislusf/weed-fs links to point to chrislu/seaweedfs 2015-04-16 19:18:06 +00:00
chrislusf 41f29e9d8c Adjust versioning. Beta version should not have a date. 2015-04-16 11:51:38 -07:00
chrislusf c1bc529654 Use public url for returned file url result 2015-04-16 11:37:05 -07:00
chrislusf 087b839354 Nomalize url before redirecting. 2015-04-16 10:02:53 -07:00
chrislusf 67146ffa78 Adjust publicUrl to volume server only.
Remove publicUrl from master server.
2015-04-16 09:29:20 -07:00
chrislusf 53b663af35 Adjust publicUrl to volume server only. 2015-04-16 09:16:43 -07:00
chrislusf 2a7972e8ea Avoid system exit if only logging failed. 2015-04-15 18:02:02 -07:00
chrislusf 7cc1f473b6 Adjust log message for glog. 2015-04-15 00:01:32 -07:00
chrislusf 49d639ecab Add error checking for file reads. 2015-04-14 23:05:33 -07:00
chrislusf c28d55d343 0.70 beta start 2015-04-14 10:10:50 -07:00
chrislusf 3a024d62df skip directory listing when paginating files. 2015-04-14 10:09:46 -07:00
Chris Lu 4483732b2c releasing 0.69 2015-04-13 23:50:33 -07:00
chrislusf 830a44a84a Add compression test 2015-04-13 23:39:11 -07:00
chrislusf 98aa9cc068 Adding filer option disableDirListing 2015-04-13 23:38:49 -07:00
chrislusf 95c373e762 Update README.md 2015-04-13 09:52:48 -07:00
chrislusf ce676ee100 Merge pull request #114 from yanyiwu/master
log image Decode error for some kind of pictures
2015-04-10 07:58:14 -07:00
yanyiwu fcfa4d4ca9 log image Decode error for some kind of pictures 2015-04-10 22:05:17 +08:00
chrislusf 71e9b302d4 Fix empty public url 2015-04-08 11:08:08 -07:00
chrislusf 3ece066700 change count to uint64 to fix #109
fix https://github.com/chrislusf/weed-fs/issues/109
2015-04-06 14:17:36 -07:00
chrislusf c37a20178e Adjust logging level. 2015-03-29 14:22:54 -07:00
chrislusf 57496e522a Update README.md 2015-03-29 11:46:09 -07:00
chrislusf b96911c517 remove verbose logging. 2015-03-29 11:44:16 -07:00
chrislusf 1b6ab2f6af Add boltdb for volume needle map
boltdb is fairly slow to write, about 6 minutes for recreating index
for 1553934 files. Boltdb loads 1,553,934 x 16 = 24,862,944bytes from
disk, and generate the boltdb as large as 134,217,728 bytes in 6
minutes.

To compare, for leveldb, it recreates index in leveldb as large as
27,188,148 bytes in 8 seconds.
For in memory version, it loads the index in

To test the memory consumption, the leveldb or boltdb index are
created. And the server is restarted. Using the benchmark tool to read
lots of files. There are 7 volumes in benchmark collection, each with
about 1553K files.
For leveldb, the memory starts at 142,884KB, and stays at 179,340KB.
For boltdb, the memory starts at 73,756KB, and stays at 144,564KB.
For in-memory, the memory starts at 368,152KB, and stays at 448,032KB.
2015-03-29 11:04:32 -07:00
chrislusf 0d23f49f74 removing unused files 2015-03-27 16:35:42 -07:00
chrislusf 020ba6c9a8 add leveldb support for needle map
This supposedly should reduce memory consumption. However, for tests
with millions of, this shows consuming more memories. Need to see
whether this will work out. If not, later boltdb will be tested.
2015-03-27 16:34:58 -07:00
chrislusf add99ed57e Add tool to see idx file contents 2015-03-27 16:29:13 -07:00
chrislusf 43689146cc fix compilation error 2015-03-24 11:09:29 -07:00
chrislusf f56339f38d [ui] add ui to status page 2015-03-24 10:52:14 -07:00
chrislusf b113760cf4 [ui] format peers 2015-03-24 00:09:20 -07:00
chrislusf 78bc7b393f tweaking ui 2015-03-22 12:50:04 -07:00
chrislusf 23012deccf Add better error message. 2015-03-19 10:48:28 -07:00
chrislusf b75ca9890d Add Initial Seaweed File System UI 2015-03-19 10:39:22 -07:00
chrislusf 6fc72b19bb add more comments 2015-03-17 14:22:56 -07:00
chrislusf 981c981fa8 one-off fix for issues/93
https://github.com/chrislusf/weed-fs/issues/93
2015-03-17 11:15:37 -07:00
chrislusf 62f5e35cbe fix public handler setup 2015-03-13 07:59:29 -07:00
chrislusf 85efc37320 marking weedfs.conf as deprecating.
The conf settings currently is duplicating with command line options.
2015-03-11 10:01:08 -07:00
chrislusf b07d81fb08 follow golint suggestions 2015-03-10 00:20:34 -07:00
chrislusf b4cb8bfd27 adding seaweedfs logo 2015-03-09 23:38:01 -07:00
chrislusf 6d9cab25d6 Add logo 2015-03-09 23:34:36 -07:00
chrislusf f511b507a5 Add read only public port on volume server
Add read only public port on volume server
2015-03-09 01:10:04 -07:00
chrislusf d48d76cb4f adding special handling to recover data if possible
For bug #87 and #93, add special handling to recover data if possible.
2015-03-09 01:10:04 -07:00
chrislusf 853701cb6b Avoid wrong way to delete on replication failure
Avoid wrong way to delete on replication failure. This deletion has bug
to write. The better fix is not to use the deletion on failure at all.
2015-03-09 01:10:04 -07:00
chrislusf 9d8a6d2562 adjust log printing 2015-03-09 01:10:04 -07:00
chrislusf d5d7ea59a1 Merge pull request #95 from stuartpb/patch-4
Consolidate toward name SeaweedFS
2015-03-08 16:43:20 -07:00
Stuart P. Bentley d33443906a Consolidate toward name SeaweedFS
This updates README.md to consistently use the name "SeaweedFS", per #94.
2015-03-06 01:40:02 +00:00
chrislusf 709c6cf8b8 Merge pull request #97 from stuartpb/patch-6
Update Google Code wiki links to point to GitHub wiki
2015-03-05 17:08:54 -08:00
Stuart P. Bentley 7be74c7d6a Update Google Code wiki links to point to GitHub wiki 2015-03-05 14:27:07 -08:00
chrislusf fb8c96c3e1 Merge pull request #96 from stuartpb/patch-5
Use GitHub Wiki for docs
2015-03-04 19:29:32 -08:00
Stuart P. Bentley 79127b267b Use GitHub Wiki for docs
I've converted all the docs pages to pages on https://github.com/chrislusf/weed-fs/wiki/:

- docs/index.rst => https://github.com/chrislusf/weed-fs/wiki
- docs/gettingstarted.rst => https://github.com/chrislusf/weed-fs/wiki/Getting-Started
- docs/clients.rst => https://github.com/chrislusf/weed-fs/wiki/Client-Libraries
- docs/api.rst => https://github.com/chrislusf/weed-fs/wiki/API
- docs/replication.rst => https://github.com/chrislusf/weed-fs/wiki/Replication
- docs/ttl.rst => https://github.com/chrislusf/weed-fs/wiki/Store-file-with-a-Time-To-Live
- docs/failover.rst => https://github.com/chrislusf/weed-fs/wiki/Failover-Master-Server
- docs/directories.rst => https://github.com/chrislusf/weed-fs/wiki/Directories-and-Files
- docs/distributed_filer.rst => https://github.com/chrislusf/weed-fs/wiki/Distributed-Filer
- docs/usecases.rst => https://github.com/chrislusf/weed-fs/wiki/Use-Cases
- docs/optimization.rst => https://github.com/chrislusf/weed-fs/wiki/Optimization
- docs/benchmarks.rst => https://github.com/chrislusf/weed-fs/wiki/Benchmarks
- docs/changelist.rst => https://github.com/chrislusf/weed-fs/wiki/Change-List
2015-03-04 22:05:25 +00:00
Chris Lu 5f9efceee3 Merge branch 'master' of github.com:chrislusf/weed-fs 2015-02-26 16:51:40 -08:00
Chris Lu 25efb4debe a 0.69 beta release 2015-02-26 16:50:47 -08:00
chrislusf a091e6f3bc display admin url on /dir/status 2015-02-25 23:59:44 -08:00
chrislusf 1704e5f1a6 adjust debug message 2015-02-25 23:59:44 -08:00
chrislusf b2f636ab8c set default volume admin port 2015-02-25 23:59:44 -08:00
chrislusf 4ee766e966 avoid auto unzip tar.gz files
fix https://github.com/chrislusf/weed-fs/issues/90
2015-02-25 23:59:44 -08:00
Chris Lu 89a06a8503 Merge branch 'master' of github.com:chrislusf/weed-fs 2015-02-25 23:59:18 -08:00
Chris Lu a506e7953f Separate read and write volume handlers. 2015-02-25 23:59:07 -08:00
chrislusf 382c521df7 Show returned content when can not parse son 2015-02-20 09:12:02 -08:00
chrislusf 226df38c95 Redirect to publicUrl
Redirect to publicUrl
2015-02-12 21:12:53 -08:00
chrislusf e282a9b06a Fix compilation error 2015-02-12 19:51:48 -08:00
chrislusf 3b1b955fc5 ensure non empty volume publicUrl 2015-02-12 17:51:13 -08:00
chrislusf e0d8259d98 Randomize http redirect.
Randomize http redirect.
Also remove unnecessary empty string checking.
2015-02-12 14:34:05 -08:00
chrislusf be35ec63cb Merge pull request #84 from EPICPaaS/master
Move the redirect url prefer to volume server's PublicUrl
2015-02-12 08:43:26 -08:00
yourchanges 7e0c080581 Move the redirect url perfer to volume server's PublicUrl 2015-02-12 18:46:56 +08:00
yourchanges 000c645d45 Move the redirect url perfer to volume server's PublicUrl (reverted from commit 701bb9af19) 2015-02-12 18:44:45 +08:00
yourchanges 701bb9af19 Move the redirect url perfer to volume server's PublicUrl 2015-02-12 18:37:26 +08:00
yourchanges 2e0d0046c4 Move the redirect url to volume server's PublicUrl (reverted from commit 2df72001b2) 2015-02-12 18:35:29 +08:00
yourchanges 2df72001b2 Move the redirect url to volume server's PublicUrl 2015-02-12 18:15:36 +08:00
yourchanges 2adf4a108b Merge pull request #6 from chrislusf/master
merge
2015-02-12 17:32:53 +08:00
chrislusf eff83a87d1 Add publicUrl for master server 2015-02-11 21:04:43 -08:00
Chris Lu f7998f8652 merge conflicts 2015-02-07 15:35:28 -08:00
chrislusf 714ccb6e2b Fix compilation error due to upstream API change.
Fix compilation error due to upstream API change.
2015-02-05 23:11:27 -08:00
chrislusf 1a04522e18 Fix option name -defaultReplication
Fix option name -defaultReplication
2015-02-05 23:03:34 -08:00
chrislusf 09f98630c0 Avoid checking folder if not using filer. fix #80
Fix https://github.com/chrislusf/weed-fs/issues/80
2015-02-05 10:12:35 -08:00
chrislusf 75f4964c48 Merge pull request #79 from aszxqw/master
use sync.RWMutex when masterNode changes
2015-02-04 02:12:38 -08:00
yanyiwu 7bfa93a283 use sync.RWMutex when masterNode changes 2015-02-04 18:05:18 +08:00
yourchanges 55c40997b1 Merge pull request #5 from chrislusf/master
merge
2015-02-03 14:03:17 +08:00
yourchanges 133181bbe4 add -reverseProxyServer="volume.xxx.com" to volume server try to fix #9 (reverted from commit 3beb80c907) 2015-02-03 13:54:44 +08:00
chrislusf b13bcdaeda Fix travis build 2015-02-02 17:27:29 -08:00
chrislusf 1791de4ae4 Avoid creating filer folder if not starting it. 2015-02-02 16:26:12 -08:00
chrislusf e381356af9 change CLI option from publicIp to publicUrl
Now the publicUrl is free style text.
2015-02-02 15:51:25 -08:00
chrislusf cc724305b6 Using Url instead of PublicUrl for volume server
Originally there are only url(ip + port), and publicUrl. Because ip was
used to listen for http service, it has less flexibility and volume
server has to be accessed via publicUrl.

Recently we added ip.bind, for binding http service.

With this change, url can be used to connect to volume servers. And
publicUrl becomes a free style piece of url information, it does not
even need to be unique.
2015-02-02 10:16:50 -08:00
chrislusf 29a325626f Merge pull request #78 from aszxqw/usercase
usecase: Data Migration Example
2015-02-02 09:02:48 -08:00
yanyiwu 74ff6bc3ed usecase: Data Migration Example 2015-02-03 00:31:39 +08:00
yanyiwu 77cab2b570 usecase: Data Migration Example 2015-02-03 00:28:28 +08:00
yourchanges 3beb80c907 add -reverseProxyServer="volume.xxx.com" to volume server try to fix #9 2015-02-02 15:37:03 +08:00
yourchanges a2b1afce78 Merge pull request #4 from chrislusf/master
merge
2015-02-02 15:21:55 +08:00
chrislusf 0e23ee4dce Update volume server's master node when masters change. 2015-01-31 12:47:04 -08:00
chrislusf e4f06a7069 Merge pull request #73 from aszxqw/master
use proto "github.com/golang/protobuf/proto"
2015-01-29 23:34:40 -08:00
yanyiwu 2f10f2960b use proto "github.com/golang/protobuf/proto" 2015-01-30 15:09:37 +08:00
chrislusf 23ed4d36c8 Merge pull request #70 from stuartpb/patch-2
Note usable methods in examples
2015-01-29 07:43:15 -08:00
chrislusf 79e84ddaed Merge pull request #71 from stuartpb/patch-3
2^60 is an exbibyte
2015-01-29 07:40:32 -08:00
Stuart P. Bentley b3e467a939 2^60 is an exbibyte
http://en.wikipedia.org/wiki/Exbibyte
2015-01-29 09:10:26 -05:00
Stuart P. Bentley b78afa688a Note usable methods in examples
This change also rewrites all example lead-ins to come *before* the examples, and not after.
2015-01-29 08:45:28 -05:00
chrislusf 440af8033d Merge pull request #69 from stuartpb/patch-1
Use proper HTTP verbs in README curl examples
2015-01-28 23:24:35 -08:00
Stuart P. Bentley 73451c68eb Use proper HTTP verbs in README curl examples
As discussed in #65
2015-01-29 01:29:41 -05:00
chrislusf 3edc33732a Merge pull request #66 from forrestsun/master
fix bug: #46
2015-01-27 10:43:05 -08:00
shenglong.sun 29cd7b3e00 fix bug: #46 2015-01-27 13:58:05 +08:00
chrislusf eb174a3de1 add mailing list 2015-01-21 16:16:24 -08:00
Chris Lu b2ad9a1110 Fix compilation error. 2015-01-18 17:11:37 -08:00
Chris Lu 7b4a53b2c1 Add optional admin port to volume server, to seperate admin operations from normal file operations. 2015-01-18 17:03:38 -08:00
chrislusf 7b10d62096 Merge pull request #60 from EPICPaaS/master
Fix the #59 and #56
2015-01-16 07:27:21 -08:00
yourchanges a86042e413 fix the #59 and #56 2015-01-16 17:30:23 +08:00
yourchanges 47bc0f2f29 Merge pull request #3 from chrislusf/master
merge
2015-01-16 14:14:10 +08:00
Chris Lu 0bd992aa44 Support multiple filers with shared Redis, Cassandra. 2015-01-14 22:20:18 -08:00
Chris Lu 41bd5179f3 Resolve Conflicts 2015-01-14 09:56:13 -08:00
Chris Lu af416189f1 Cleanup error printing. 2015-01-13 17:04:41 -08:00
chrislusf 996a1789e8 Merge pull request #58 from carmark/master
fix some typos
2015-01-13 08:25:22 -08:00
Lei Xue 029e3a3822 fix some typos 2015-01-13 18:46:56 +08:00
Chris Lu 5afdc469a3 Separate into admin and public mux for volume servers. 2015-01-13 00:45:26 -08:00
Chris Lu 09bc196958 Refactoring volume server options. 2015-01-13 00:36:44 -08:00
Chris Lu ef191f2901 Refactoring volume server options. 2015-01-13 00:27:51 -08:00
Chris Lu 8f72a1965f Fix go vet warnings. 2015-01-12 21:20:11 -08:00
Chris Lu d102443630 v0.68 2015-01-12 21:07:06 -08:00
Chris Lu 352ef2830c Add caching volume locations to batch volume id lookup. 2015-01-11 23:01:31 -08:00
Chris Lu 2495ce6707 Adjust .gitignore 2015-01-09 19:59:54 -08:00
chrislusf 889099ac0d Merge pull request #56 from EPICPaaS/master
Fix the first form multi-part item is not a  "file type part" problem in "ParseUpload()"
2015-01-09 11:55:05 -08:00
yourchanges 7481b7376d Fix the first form multi-part item is not a "file type part" problem in "ParseUpload()" 2015-01-10 03:22:16 +08:00
yourchanges 9601880e32 Merge pull request #2 from chrislusf/master
merge
2015-01-10 02:51:26 +08:00
chrislusf 2c1a846279 Merge pull request #54 from aszxqw/master
add w.Write for FilerServer HTTP response
2015-01-09 07:43:10 -08:00
yanyiwu 543f5af5af add w.Write for FilerServer HTTP response 2015-01-09 19:24:49 +08:00
chrislusf ab20cf8197 Merge pull request #53 from aszxqw/master
fix bug: 'http: multiple response.WriteHeader calls'
2015-01-08 06:59:30 -08:00
yanyiwu fe91fd00ad fix bug: 'http: multiple response.WriteHeader calls' 2015-01-08 19:04:10 +08:00
yanyiwu 7304c840e3 update .gitignore 2015-01-08 17:38:01 +08:00
chrislusf ac2ef389d1 Merge pull request #52 from mcqueenorama/master
more args for server
2015-01-08 00:48:54 -08:00
Brian McQueen e7741db9a2 fixed description error in redis.database 2015-01-08 00:44:41 -08:00
Brian McQueen cec2b3724c add server options to set redis and cassandra in the filer and corrected filer option description text 2015-01-08 00:41:27 -08:00
Chris Lu 5b5d6341e5 Set http status after modifying response headers. 2015-01-08 00:19:32 -08:00
chrislusf 31979d6192 Merge pull request #51 from aszxqw/master
add some String() to make codes easier to read and debug
2015-01-08 00:12:56 -08:00
yanyiwu cacfc85869 add some String() to make codes easier to read and debug 2015-01-08 15:54:50 +08:00
chrislusf f2b07d6051 Merge pull request #48 from aszxqw/master
fix bug about : writed needle into localfile twice when replicating
2015-01-07 05:11:17 -08:00
yanyiwu 7d810a15c0 fix bug about : writed needle into localfile twice when replicating, because of the ip is not equal : ":8080" != "127.0.0.1:8080" 2015-01-07 16:47:57 +08:00
Chris Lu f7f6f331db Adjust documentation. 2015-01-06 22:38:56 -08:00
Chris Lu e4531fc1e6 Add Redis support for Distributed Filer store. 2015-01-06 20:15:13 -08:00
Chris Lu d77f3120c3 Adjust function name. 2015-01-06 19:34:11 -08:00
Chris Lu c25c9aff41 Merge branch 'master' of github.com:chrislusf/weed-fs 2015-01-06 19:26:58 -08:00
Chris Lu cceb5768c7 Adjust function name. 2015-01-06 19:26:48 -08:00
chrislusf 479a4699e3 Merge pull request #45 from aszxqw/master
fix bug about the collection
2015-01-06 05:51:03 -08:00
yanyiwu 0b192917f8 fix bug about the collection in volume is wrong when curl -F "file=@/tmp/test.jpg" "localhost:9333/submit?collection=picture" 2015-01-06 19:31:26 +08:00
Chris Lu 7471bccb9b Adjust document script. 2015-01-05 23:24:12 -08:00
Chris Lu 25568245cf Adjust minor document text. 2015-01-05 23:20:42 -08:00
Chris Lu 8d9a77c9b7 Adjust documents for distributed filer metadata store. 2015-01-05 23:16:59 -08:00
Chris Lu 44f53cba1d Adjust documents for distributed filer metadata store. 2015-01-05 23:06:27 -08:00
Chris Lu 49784d7f28 Add support for distributed filer metadata store. 2015-01-05 23:03:27 -08:00
Chris Lu 165734ce11 Refactoring for supporing cassandra as filer meta data store 2015-01-05 14:58:30 -08:00
Chris Lu a3e4145e8a refactoring for later security changes 2015-01-05 14:20:04 -08:00
chrislusf 878d1aa35e Merge pull request #42 from OGrape/master
Weed "minimal" docker image
2015-01-01 21:23:33 -08:00
ブドウの鳥 3d3a810488 Update gettingstarted.rst 2015-01-01 21:52:42 -07:00
ブドウの鳥 b51282ae95 Update gettingstarted.rst
Adding instructions to build docker image
2015-01-01 20:59:56 -07:00
Sam Ng 329c5915fe Go Build Dockerfile 2015-01-01 18:56:51 -07:00
Sam Ng e778d04740 An extremely small 19.6 MB docker image for weed-fs 2015-01-01 14:25:59 -07:00
chrislusf 763f5e16c7 Merge pull request #38 from aszxqw/master
fix
2014-12-26 01:29:30 -08:00
yanyiwu 5b7628cf08 use github.com/golang/protobuf/proto instead of code.google.com/p/goprotobuf/proto 2014-12-26 16:59:53 +08:00
yanyiwu 5a40f539f2 fix bug: upload a file which already existed return a wrong file size. 2014-12-26 15:36:33 +08:00
yanyiwu 12d86a0f1e Merge branch 'master' of github.com:chrislusf/weed-fs 2014-12-26 13:37:29 +08:00
yanyiwu 089eb8ad39 add String function for needle to print 2014-12-26 13:29:44 +08:00
chrislusf 8651f7c727 Add change list. 2014-12-21 23:27:04 -08:00
chrislusf ed07d3c8c6 Merge branch 'master' of https://github.com/chrislusf/weed-fs 2014-12-21 23:06:56 -08:00
chrislusf 33602a03a4 misc doc changes 2014-12-21 23:06:42 -08:00
chrislusf c02a2e25c4 Update ttl.rst 2014-12-21 22:32:51 -08:00
chrislusf 986797c1c8 Adjust wording. 2014-12-21 22:10:53 -08:00
chrislusf 1384fed3eb Update ttl.rst 2014-12-21 22:03:42 -08:00
chrislusf c9b0cec5b8 Include ttl in index 2014-12-21 22:00:59 -08:00
chrislusf 305c36ddd1 Update ttl.rst 2014-12-21 18:08:07 -08:00
chrislusf 01d96433b1 add ttl.rst 2014-12-21 18:01:31 -08:00
chrislusf 6ec6541a0d Update index.rst 2014-12-21 17:49:38 -08:00
chrislusf 2b1369277f Merge pull request #33 from mcqueenorama/master
turn on filer when file.redirectOnRead
2014-12-14 20:43:43 -08:00
Brian McQueen d56c748fa8 switch it back to chris's repo 2014-12-14 00:35:26 -08:00
Brian McQueen 57ec736941 make it turn on the filer when filer.redirectOnRead is set 2014-12-14 00:33:16 -08:00
Brian McQueen c0dfdf4392 switch to my forked repo 2014-12-14 00:20:21 -08:00
Brian McQueen a3583e4e7c Merge branch 'master' of https://github.com/chrislusf/weed-fs 2014-12-14 00:13:51 -08:00
chrislusf e431d4121e Add optional http redirect for filer GET requests. 2014-12-08 20:34:27 -08:00
chrislusf 124c232a3b Merge branch 'master' of https://github.com/chrislusf/weed-fs 2014-12-08 20:29:38 -08:00
chrislusf 52180f386b Add read-write lock to guard topology changes on new collections and ttls. 2014-12-08 20:29:25 -08:00
chrislusf ba972694c7 Add filer option to redirect instead of proxying to volume server on file GET requests. 2014-12-08 20:27:26 -08:00
Chris Lu 482e3fb973 Improve Benchmark tool's performance. 2014-12-05 12:00:13 -08:00
chrislusf 7a6394378c Remove a volume server concurrent connection limit. 2014-12-04 21:22:09 -08:00
chrislusf 89fd1e4b6e Add more thread safe counters. Tighten thread synchronization. 2014-12-04 18:30:44 -08:00
chrislusf ed7b00bf02 Update README.md 2014-12-03 21:37:00 -08:00
chrislusf 9ebbf655c0 Merge pull request #28 from ShaoshanLiu/master
add instructions for users who are not familiar with golang
2014-12-03 21:31:49 -08:00
Shaoshan Liu 74b76a2c41 add instructions for users who are not familiar with golang 2014-12-03 21:04:02 -08:00
Chris Lu 6c5a3d3dbf Increase performance by reusing []byte, reducing GC. 2014-11-30 21:55:53 -08:00
Chris Lu ca67ed69a1 Change name to Seaweed. 2014-11-28 17:02:10 -08:00
Chris Lu 9d03cd20ba De-support go 1.2 2014-11-28 16:55:40 -08:00
Chris Lu dbd7a0c92d Merge branch 'master' of git@github.com:chrislusf/weed-fs.git 2014-11-28 16:35:08 -08:00
Chris Lu 8af4753002 Write request id to first 8 bytes of a file, instead of whole file, for
better write performance.
2014-11-28 16:34:03 -08:00
chrislusf 8cdfd5852d Merge pull request #22 from aszxqw/patch-1
Update Dockerfile
2014-10-31 11:59:41 -07:00
Yanyi Wu cd1b70caf7 Update Dockerfile 2014-11-01 01:48:19 +08:00
Chris Lu b0e8f8ca2a Upgraded to 0.97 goclipse. 2014-10-27 01:10:33 -07:00
Chris Lu 7ce628bf09 Clean raft configurations if "peers" option is set. 2014-10-27 01:09:45 -07:00
Chris Lu 179d36ba0e formatting code by: goimports -w=true . 2014-10-26 11:34:55 -07:00
Chris Lu a5d6e70299 fix commenting error. 2014-10-26 11:25:02 -07:00
Chris Lu f527fc1d5e adjust visibility 2014-10-25 23:45:31 -07:00
Chris Lu 30bcda7136 fix typo 2014-10-25 18:10:32 -07:00
Chris Lu b85eb293fe fix doc about submit api 2014-10-23 09:55:05 -07:00
Chris Lu af106fe961 Merge branch 'master' of git@github.com:chrislusf/weed-fs.git 2014-10-21 01:28:58 -07:00
Chris Lu b5aa2ef605 Add master bind ip address option. 2014-10-21 01:28:17 -07:00
Chris Lu 670b240a26 Fix help text error. 2014-10-21 01:27:40 -07:00
Chris Lu e9a8999f63 print error the correct way. 2014-10-21 01:27:06 -07:00
yourchanges f7bcd8e958 Merge pull request #1 from chrislusf/master
update
2014-10-21 15:50:48 +08:00
bmcquee bd664def45 Revert "fix func name HasWriableVolume"
This reverts commit bff7b71389.
2014-10-19 23:08:01 -07:00
bmcquee 02ae8b98a5 Revert "change wriable to writeable"
This reverts commit 626b896448.
2014-10-19 23:07:58 -07:00
bmcquee 626b896448 change wriable to writeable 2014-10-19 23:01:15 -07:00
bmcquee 7ca10d8dcf add another logging line verbosity 2 2014-10-19 20:03:00 -07:00
bmcquee bff7b71389 fix func name HasWriableVolume 2014-10-19 08:51:07 -07:00
chrislusf a3c17f17b1 Merge pull request #20 from mcqueenorama/master
fix link to download binaries
2014-10-19 08:27:18 -07:00
bmcquee 92653d2c41 fix link to download binaries 2014-10-18 20:17:28 -07:00
chrislusf cbaaf1b539 Update Dockerfile
revert back to original version to keep documentation consistent.
2014-10-14 17:29:23 -07:00
Chris Lu 88e7c98e6e tweaking the docker file 2014-10-08 18:13:23 -07:00
Chris Lu a09240391f Adjust wiki syntax error. 2014-09-25 22:34:06 -07:00
Chris Lu 599d0ae21b Add benchmark to the introduction page. 2014-09-25 22:32:12 -07:00
Chris Lu b225793103 Move introduction page to github. 2014-09-25 22:25:51 -07:00
Chris Lu d0229d99ed name change on documents 2014-09-25 21:53:32 -07:00
chrislusf 348a50052e Merge pull request #15 from aszxqw/upstream_master
Changing to github !!! Thanks!
2014-09-25 21:24:08 -07:00
wyy 620b1244b4 update readme.md 2014-09-25 17:07:24 +08:00
wyy 4126280d55 use github.com/chrislusf instead of github.com/aszxqw 2014-09-25 16:57:22 +08:00
wyy d39c62bbed add .gitignore 2014-09-25 16:34:26 +08:00
wyy 2f1cf164b9 update readme.md 2014-09-25 16:28:32 +08:00
wyy 1cd19447e3 use github.com/aszxqw instead of code.google.com/p 2014-09-25 00:47:09 +08:00
Chris Lu a2f8d985fb Fix typo. 2014-09-20 23:34:13 -07:00
Chris Lu ba179b1542 Add "-ip.bind" option when starting volume servers.
Also some Weed->Seaweed changes.
2014-09-20 23:30:35 -07:00
Chris Lu ca16cfa147 adjust for external API changes 2014-09-20 22:10:58 -07:00
Chris Lu 794b755f1d rename to Seaweed File System 2014-09-20 21:18:26 -07:00
Chris Lu fa9318914c Merge branch 'master' of https://github.com/chrislusf/weed-fs 2014-09-20 21:05:34 -07:00
Chris Lu 7920b4685e Adding unit tests for volume ttl. 2014-09-20 20:51:24 -07:00
Chris Lu f7094d7a99 version 0.64 2014-09-20 12:39:42 -07:00
Chris Lu b9aee2defb add TTL support
The volume TTL and file TTL are not necessarily the same. as long as
file TTL is smaller than volume TTL, it'll be fine.

volume TTL is used when assigning file id, e.g.
http://.../dir/assign?ttl=3h

file TTL is used when uploading
2014-09-20 12:38:59 -07:00
Chris Lu a092794804 use error to report error 2014-09-04 19:34:43 -07:00
Chris Lu 4be5ccd0c8 resolve directory log file error
avoid possible race condition
2014-09-04 19:26:31 -07:00
Chris Lu 69343c5951 adding ttl field to volume super block 2014-08-31 23:25:54 -07:00
Chris Lu 57a4549d86 wrap etag value with double quotes 2014-08-26 10:15:12 -07:00
Chris Lu ce4acecaa8 Fix filer proxing http status code
Double quote etag value.
2014-08-25 12:02:04 -07:00
Chris Lu 4c58cef24a a bit refactoring to prepare for volume format change and backward
compatibility.
2014-08-25 11:37:00 -07:00
Chris Lu aac5fa49de remove the submit via volume server api. 2014-08-11 07:41:00 -07:00
Chris Lu df78466a12 remove uploading stated from volume server. 2014-08-05 18:14:12 -07:00
chrislusf 78ccbbf3d0 Merge pull request #10 from ernado/master
Added docker example to docs
2014-07-25 08:11:52 -07:00
ernado b5c89b9a73 fixed RTD link from fork to official docs 2014-07-25 12:58:06 +04:00
ernado 6cd0b961da added docker example 2014-07-25 12:48:40 +04:00
Chris Lu e67afa8715 Merge branch 'master' of https://github.com/chrislusf/weed-fs 2014-07-24 12:24:51 -07:00
Chris Lu bcd36dedb4 released 0.62 with solaris support 2014-07-24 12:24:01 -07:00
chrislusf 4b97358100 Merge pull request #7 from ernado/master
Read the docs integration
2014-07-23 11:00:38 -07:00
ernado c65a9f5639 added benchmarks page 2014-07-23 20:24:32 +04:00
ernado c38b50e9fc added optimizations page 2014-07-23 20:19:56 +04:00
ernado 3d8d18dd8f added directories and files page 2014-07-23 20:15:25 +04:00
ernado f903727476 added use cases page 2014-07-23 20:08:00 +04:00
ernado 0812346e56 added failover page 2014-07-23 20:03:24 +04:00
ernado 17fcf828d3 added replication docs 2014-07-23 16:30:16 +04:00
ernado b41d7bd5a3 fixed url for camlistore 2014-07-23 16:15:56 +04:00
ernado 73f32be01f fixed title 2014-07-23 16:12:58 +04:00
ernado bdacb5c25a added http api docs 2014-07-23 16:10:27 +04:00
ernado dddbd86649 capitalize authors names 2014-07-23 15:48:30 +04:00
ernado c57884a295 added projects and websites 2014-07-23 15:46:28 +04:00
ernado 0f8ad6c40e fixed names 2014-07-23 15:41:10 +04:00
ernado 027d86794f added client libraries 2014-07-23 15:38:03 +04:00
ernado 34eb00de33 fixed typo mirrow-mirror 2014-07-23 13:31:50 +04:00
ernado fe439f54f5 added godoc ref 2014-07-23 13:30:42 +04:00
ernado 3188598367 formatting for getting started page of -h examples 2014-07-23 13:10:06 +04:00
ernado 2af5d9fb15 Merge branch 'master' of github.com:ernado/weed-fs 2014-07-23 13:07:00 +04:00
ernado 66689f2381 added getting started page 2014-07-23 13:06:42 +04:00
Aleksandr Razumov d6c4734e34 added rtd badge 2014-07-23 12:31:41 +04:00
ernado 3333577e06 read the docs fix 2014-07-23 12:23:21 +04:00
ernado 181e7a547a changed docs theme 2014-07-23 12:19:32 +04:00
ernado 3b3391cd65 added initial docs 2014-07-23 12:16:57 +04:00
Chris Lu dc03626167 add download url to github readme 2014-07-22 12:22:17 -07:00
Chris Lu 530927db64 Add Etag support 2014-07-22 00:24:50 -07:00
Chris Lu 5d88cec2df 1. pass through http response headers
2. set http status 201 for creating files
2014-07-21 14:25:51 -07:00
Chris Lu a3fb644d86 fix wrong error printing that caused panic 2014-07-21 13:42:15 -07:00
Chris Lu b8bef16c98 test move function 2014-07-20 23:48:48 -07:00
Chris Lu 5f975f5ce8 fix test error due to changed api 2014-07-20 23:45:32 -07:00
Chris Lu df2d3ea7c0 fix old tests that's found not working during travis integration. 2014-07-20 23:41:25 -07:00
Chris Lu a0b2582a75 comments change 2014-07-20 23:17:29 -07:00
Chris Lu 77fd5ecd98 Add /admin/mv to move a file or a folder 2014-07-20 23:12:49 -07:00
chrislusf 8e7f08d04d Merge pull request #2 from ernado/master
Travis integration and Dockerfile
2014-07-20 23:07:25 -07:00
Aleksandr Razumov 34ccb4f6c9 Update .travis.yml 2014-07-21 09:21:16 +04:00
ernado e5a5dbde40 added build status to readme 2014-07-21 09:17:36 +04:00
ernado b88603896a added dockerfile 2014-07-21 09:13:33 +04:00
ernado 5d9ea0f3d4 added travis file 2014-07-21 09:09:53 +04:00
Chris Lu 5615604253 Merge branch 'master' of https://github.com/chrislusf/weed-fs 2014-07-20 17:54:03 -07:00
Chris Lu 4ac8f2e59d adjust file name 2014-07-20 17:42:09 -07:00
chrislusf 68bf82643c Create README.md 2014-07-15 18:07:16 -07:00
Chris Lu 5f19af8fce compress *.htm file 2014-07-08 09:32:55 -07:00
Chris Lu 413e5c145c lowercase when checking file name extensions. 2014-07-05 18:01:17 -07:00
Chris Lu 38231b6891 return image size when client image processing 2014-07-05 00:43:41 -07:00
Chris Lu fd9f924ad7 add a convenient function to preprocess images on client side. 2014-07-04 18:03:48 -07:00
Chris Lu d85b1d70db released 0.61, prepare for 0.62 beta 2014-06-17 11:45:21 -07:00
Chris Lu cb28c26398 Setting application/json for json result.
Setting application/javascript for jsonp result.
2014-06-13 18:16:03 -07:00
Chris Lu d7f6af09e6 Better guessing mime type with octstream 2014-06-08 21:02:20 -07:00
Chris Lu d2f3cab8e1 Remove glog from http_util for better reusability. 2014-06-07 13:27:28 -07:00
Chris Lu a437d77431 only set lookup cache when successful 2014-06-02 09:22:23 -07:00
Chris Lu 4b7b439be9 Reduce memory usage for "weed fix" 2014-05-31 17:10:51 -07:00
Chris Lu 08cbb2c345 start to code for 0.61 release 2014-05-29 23:24:41 -07:00
Chris Lu faf497feb8 Important Fix: Avoid overwriting the index file!!! 2014-05-29 19:19:03 -07:00
Chris Lu 5f58da8de7 0.60 beta start 2014-05-27 09:10:32 -07:00
Chris Lu e60af7b82e Add partial content request support. 2014-05-26 21:15:05 -07:00
Chris Lu 3e5b4da361 fix compilation error 2014-05-26 17:36:41 -07:00
Chris Lu 625f880b15 Adjust "weed server" parameters. 2014-05-26 17:34:54 -07:00
Chris Lu b5f99b26eb Add volume id lookup caching 2014-05-25 14:01:54 -07:00
Chris Lu 38260fcfb1 rename to _vacuum.go 2014-05-19 21:17:04 -07:00
Chris Lu fe3f06435e Refactor out volume vacuum. 2014-05-19 20:54:39 -07:00
Chris Lu e7aaa24da8 Refactor out volume vacuum. 2014-05-19 19:24:35 -07:00
Chris Lu e8e8d11bd3 Refactor out weedfs vacuum. 2014-05-19 19:18:39 -07:00
Chris Lu c1307103b2 fix orientation for all jpg files 2014-05-16 01:10:46 -07:00
Chris Lu 34e03e7cf6 iphone usually has upper cased .JPG extension
refactor
2014-05-15 01:56:08 -07:00
Chris Lu 8ff0d17d6a defauting images.fix.orientation option to true 2014-05-15 01:16:56 -07:00
Chris Lu dcd12576c6 Add option to auto fix jpg orientation 2014-05-15 01:08:00 -07:00
Chris Lu 025589adf8 Add auto fixing jpg file orientation. 2014-05-15 00:30:46 -07:00
Chris Lu f7d6909b6f 1. refactor, move image resizing to its own package
2. make code compile
2014-05-14 23:44:19 -07:00
Chris Lu 5367d96512 0.59 beta 2014-05-13 19:26:05 -07:00
Chris Lu dac95464b8 better handling of os signals 2014-05-13 15:04:04 -07:00
Chris Lu 029923329d add os.Kill signal to handle.
go fmt some code.
2014-05-13 11:32:10 -07:00
Chris Lu dc24bad791 releasing 0.58 to handle control+c interrupts.
compilable now. but FUSE mount is not working.
2014-05-13 11:25:48 -07:00
Chris Lu 750e1aaaa5 Add control+c or INT handling 2014-05-13 00:05:18 -07:00
Chris Lu 7e0ae72b07 Add control+c or INT handling 2014-05-13 00:04:28 -07:00
Chris Lu 982aaa41b9 Add control+c or INT handling 2014-05-13 00:03:10 -07:00
Chris Lu 68ceea3f8d support file names with a comma inside. 2014-05-12 22:59:00 -07:00
Chris Lu 328aa48c6a Can compile now. not working just yet. 2014-05-12 22:57:23 -07:00
Chris Lu 8ceaaa6c4f version upgrade 2014-05-08 09:40:01 -07:00
Chris Lu 1c30a780a7 fix image serving performance problem introduced in last release. 2014-05-07 12:52:42 -07:00
Chris Lu 729716ab7a Add cpu profiling option. 2014-05-07 10:17:06 -07:00
Chris Lu 87b98711f7 A hidden feature: dynamically resize image.
Adding width=xxx or height=xxx, or both, can dynamically resize a
gif,jpg,png. But the performance is bad. So, not recommending, but you
can use it if you insist. :)
2014-04-25 22:28:01 -07:00
Chris Lu d344e87de0 Adjust command line options.
1. switch to use -publicIp instead of -publicUrl
2. -ip can be empty. It will listen to all available interfaces.
3. For "weed master", these options are changed:
  -masterPort => -master.port
  -peers => -master.peers
  -mdir => -master.dir
  -volumeSizeLimitMB => -master.volumeSizeLimitMB
  -conf => -master.conf
  -defaultReplicaPlacement => -master.defaultReplicaPlacement
  -port => -volume.port
  -max => -volume.max
2014-04-25 22:09:42 -07:00
Chris Lu 8c04c5ed5f remove the println 2014-04-22 23:10:01 -07:00
Chris Lu 1818a2a2da Change to protocol buffer for volume-join-masster message
Reduced size to about 1/5 of the previous json format message
2014-04-21 02:11:10 -07:00
Chris Lu 637469e656 log the volume server connected to which master server 2014-04-20 23:28:05 -07:00
Chris Lu 5f2604b1f7 start 0.56 beta 2014-04-17 22:40:28 -07:00
Chris Lu 5c0c5a4913 cut 0.55 2014-04-17 22:40:06 -07:00
Chris Lu 83c0c9843d Add option to recursively delete a folder. 2014-04-17 22:33:21 -07:00
Chris Lu e378f9892d Avoid showing the first directory when listing the root directory 2014-04-17 22:32:21 -07:00
Chris Lu 3ee017d350 0.55 beta 2014-04-17 00:32:45 -07:00
Chris Lu 3b5035c468 1. v0.54
2. go vet found many printing format errors
2014-04-17 00:16:44 -07:00
Chris Lu 51939efeac 1. volume server now sends master server its max file key, so that
master server does not need to store the sequence on disk any more
2. fix raft server's failure to init cluster during bootstrapping
2014-04-16 23:43:27 -07:00
Chris Lu 9653a54766 added typed join result 2014-04-16 17:29:58 -07:00
Chris Lu da0480ad72 adjust to upgraded Raft library 2014-04-15 17:56:47 -07:00
Chris Lu 4ecf5956d7 Add types to uploading 2014-04-15 10:01:13 -07:00
Chris Lu 7ad6cd35e8 Use type ClusterStatusResult for writing and reading results 2014-04-15 09:30:08 -07:00
Chris Lu cb56322937 minor textual change 2014-04-15 09:20:28 -07:00
Chris Lu 68021c6fc3 Use type AssignResult when writing and reading result. 2014-04-15 09:20:04 -07:00
Chris Lu cbc5a76e80 Added batch file deleting. 2014-04-15 09:09:40 -07:00
Chris Lu b771f060f1 rename variable name 2014-04-14 01:07:11 -07:00
Chris Lu 2eb9014606 rename file from lookup_volume_id.go to lookup.go 2014-04-14 01:05:57 -07:00
Chris Lu 56a3d30e75 batch delete on volume servers 2014-04-14 01:00:09 -07:00
Chris Lu 460923f094 use fileId as the official name for the file identifier 2014-04-14 00:28:48 -07:00
Chris Lu 85894160c6 refactor: split master handler into 2 files 2014-04-14 00:23:52 -07:00
Chris Lu 7337c29b90 refactor: split volume handlers into 3 files 2014-04-14 00:13:18 -07:00
Chris Lu 5878f7c3a1 refactor lookup result types into package "operation" 2014-04-13 23:56:15 -07:00
Chris Lu f20ef922fd 1. add batched volume lookup handler
2. working-in-progress batch delete
2014-04-13 23:41:34 -07:00
Chris Lu 161526555f remove unused code additional functions for glog 2014-04-13 10:20:43 -07:00
Chris Lu 963023898e adding instructions on how to use logging 2014-04-13 10:18:10 -07:00
Chris Lu 931bf2a50a releasing 0.53, and then move to 0.54 beta 2014-04-13 03:10:59 -07:00
Chris Lu 0abd809663 Correct logic to allocate volume slots 2014-04-13 03:06:58 -07:00
Chris Lu 6084e7670a fix bug when reading back the replica settings! 2014-04-13 03:06:15 -07:00
Chris Lu 47620bb27a correct assign logic for rack level. Still need to fix data center
level.
2014-04-13 02:26:22 -07:00
Chris Lu ae2ef6e41d mostly working correctly, but may have failed volume growing attempts
when slots are tight.
2014-04-13 02:16:45 -07:00
Chris Lu f7f582ec86 1. refactoring, merge "replication" logic into "topology" package
2. when growing volumes, additional preferred "rack" and "dataNode"
paraemters are also provided. Previously only "dataCenter" paraemter is
provided.
2014-04-13 01:29:52 -07:00
Chris Lu 008aee0dc1 Add retrying logic to wait for other peers during cluster bootstrapping. 2014-04-11 16:23:58 -07:00
Chris Lu 7c82e2316b starting 0.53 beta 2014-04-10 13:47:39 -07:00
Chris Lu 79142614ea 0.52 version 2014-04-10 13:47:12 -07:00
Chris Lu 5f4dc11409 1. root dir has id of 0
2. only delete empty folders
3. correct listing files under a folder
2014-04-09 21:01:48 -07:00
Chris Lu abde40377c a correct implementation of filer 2014-04-09 09:44:58 -07:00
Chris Lu 67be8a5af8 adding filer!!! 2014-03-30 20:57:25 -07:00
Chris Lu d6aa6239de fix to avoid empty sub directory 2014-03-30 13:32:24 -07:00
Chris Lu 51fafdb525 more robust filer 2014-03-30 13:26:44 -07:00
Chris Lu 2861275fb6 working filer server! 2014-03-30 11:28:04 -07:00
Chris Lu 259c7d66f7 all in progress version will just be beta 2014-03-28 12:19:11 -07:00
Chris Lu 25a3c47def Issue 65: weed-fs 0.51 does not compile under windows 2014-03-28 12:18:01 -07:00
Chris Lu 59f6a13609 adding lots of different stats 2014-03-26 13:22:27 -07:00
Chris Lu 39b774a131 1. adding statistics reporting
2. refactor version to util package
2014-03-25 13:46:59 -07:00
Chris Lu 6e0601a73b 0.51 2014-03-24 10:06:23 -07:00
Chris Lu a0955aa4dd refactor functions 2014-03-23 21:57:10 -07:00
Chris Lu b1f083cb60 fix delayed deletion 2014-03-23 21:56:24 -07:00
Chris Lu 5c6a166761 better delayed deletion 2014-03-20 13:58:56 -07:00
Chris Lu 7251e357e7 enhance deletion operation 2014-03-20 13:30:34 -07:00
Chris Lu 7c5c94785c switch to idle timeout instead of read timeout 2014-03-20 11:07:15 -07:00
Chris Lu c22e5c1c51 now the volume compaction bug is fixed. 2014-03-19 04:48:58 -07:00
Chris Lu 0563773944 switch to ReadAt() for thread-safe read
fix bugs during volume compaction
2014-03-19 04:48:13 -07:00
Chris Lu 463589da01 adjusting logs 2014-03-19 04:46:42 -07:00
Chris Lu 96b67a7c35 adjusting logs 2014-03-19 04:45:25 -07:00
Chris Lu 252e553ef2 add deletion during benchmarking 2014-03-19 04:44:59 -07:00
Chris Lu b2e8bfb54e adjusting logs 2014-03-19 04:43:21 -07:00
Chris Lu 76bf72e8ef adjust log level 2014-03-19 04:42:57 -07:00
Chris Lu 37dd41ab91 print out log message 2014-03-19 04:41:41 -07:00
Chris Lu 3dbebfd1e1 Thread-safe fixes:
1. avoid sharing []byte
2. switch to use ReadAt()
2014-03-19 04:41:16 -07:00
Chris Lu e5e6eeda83 found bugs with 0.50, backing off for now 2014-03-19 01:30:53 -07:00
Chris Lu d8bc540130 Last important fix is version-bump-up-worthy: prevent heartbeat lost
when vacuuming
2014-03-18 23:50:03 -07:00
Chris Lu af32b52727 1. no locks for all read operations! Switching to pread for all reads.
2. prevent heartbeat lost when vacuuming, by removing locks on Size()
function
2014-03-18 23:48:01 -07:00
Chris Lu 2841d59fb0 randomize the file size a little bit 2014-03-18 23:45:02 -07:00
Chris Lu 3fec41b911 remove unnecessary code 2014-03-18 22:32:29 -07:00
Chris Lu 92afbb858a adjusting volumeSizeLimitMB default value and descriptions 2014-03-17 15:10:12 -07:00
Chris Lu 988f9d60d5 so many bug fixes, well worth an version bump 2014-03-16 13:51:32 -07:00
Chris Lu f8b1d48f82 deal with empty learder() cases 2014-03-16 13:50:46 -07:00
Chris Lu 1040761ab6 avoid herding effect by double checking 2014-03-16 13:50:20 -07:00
Chris Lu 1c044280d6 reusing http connections in raft server 2014-03-16 13:49:49 -07:00
Chris Lu 41143b3b78 toughen weedfs clustering, adding synchronizing max volume id among
peers in order to avoid the same volume id being assigned twice
1. moving raft.Server to topology
2. adding max volume id command for raft
2014-03-15 23:03:49 -07:00
Chris Lu fb75fe852c ignore "-peers" option if cluster is already bootstrapped 2014-03-15 00:36:51 -07:00
Chris Lu 6cedaf4356 fix glog format 2014-03-15 00:34:21 -07:00
Chris Lu 0c42c69e94 less greedy concurrency level, reducing open files 2014-03-14 01:53:47 -07:00
Chris Lu eec67d6008 fix bug on volume growing failure where free space equals what's
required.
more meaningful volume allocation errors
2014-03-13 12:13:39 -07:00
Chris Lu 946aa6d1e7 error message change 2014-03-13 12:11:50 -07:00
Chris Lu 7621b9b8a9 help content textual changes 2014-03-13 12:11:26 -07:00
Chris Lu 7a8bc2e19e avoid sharing same err variable 2014-03-12 15:17:23 -07:00
Chris Lu 097aac2328 adjusting default read time out 2014-03-12 15:05:07 -07:00
Chris Lu 24cc55b444 1. increase default concurrency level
2. efficient stats collection and calculation
3. accurate error count
2014-03-12 14:10:28 -07:00
Chris Lu d30052ce85 adjusting error message 2014-03-12 14:08:57 -07:00
Chris Lu ff0560ee03 adjust error message 2014-03-12 14:07:30 -07:00
Chris Lu c3ce024fc1 reusing http connections 2014-03-12 14:07:01 -07:00
Chris Lu 054374c765 in progress, trying to make benchmark working better to reuse http
connections.
2014-03-12 10:30:57 -07:00
Chris Lu 466a55b06d fix error message 2014-03-12 10:25:05 -07:00
Chris Lu 6f2d590617 fix error message 2014-03-12 06:23:07 -07:00
Chris Lu c169429c33 fix https://code.google.com/p/weed-fs/issues/detail?id=64 2014-03-12 06:19:30 -07:00
Chris Lu c81f85e16d add percentage of benchmark progress
plan to release v0.48
2014-03-10 13:34:06 -07:00
Chris Lu 45757b8b55 minor output format change 2014-03-10 13:22:08 -07:00
Chris Lu 1f0a564e43 adding progress report during benchmarking 2014-03-10 13:21:21 -07:00
Chris Lu cd10c277b2 can now delete a collection! Is this a dangerous feature? Only enabling
deleting "benchmark" collections for now.
2014-03-10 11:43:54 -07:00
Chris Lu a121453188 benchmarking writing data to a specific collection 2014-03-09 23:54:07 -07:00
Chris Lu eac9c4d86b better benchmarking statistics 2014-03-09 23:12:05 -07:00
Chris Lu 86b17e8972 a kind of working benchmark 2014-03-09 19:42:50 -07:00
Chris Lu c830b60f36 refactoring 2014-03-09 18:50:45 -07:00
Chris Lu e6e85a6b2c truncate file content during creating 2014-03-09 18:50:09 -07:00
Chris Lu 7283d68e32 fixed redirection error 2014-03-03 08:20:46 -08:00
Chris Lu ab9206c38e spelling error with parameter name! 2014-03-02 23:32:54 -08:00
Chris Lu 27c74a7e66 Major:
change replication_type to ReplicaPlacement, hopefully cleaner code
works for 9 possible ReplicaPlacement
xyz
x : number of copies on other data centers
y : number of copies on other racks
z : number of copies on current rack
x y z each can be 0,1,2

Minor:
weed server "-mdir" default to "-dir" if empty
2014-03-02 22:16:54 -08:00
Chris Lu edae676913 1. volume server auto detect clustered master nodes
2. remove operation package dependency on storage
2014-02-14 17:10:49 -08:00
Chris Lu ef4c2c0d1e cleaner cluster messages 2014-02-09 23:37:29 -08:00
Chris Lu 67125688ed Avoid creating *.dat file when reading and it does not exist 2014-02-06 17:32:06 -08:00
Chris Lu 91829057c5 set to 400 Bad Request when failed to parse file id, recommended by
claudiu
2014-02-06 12:03:25 -08:00
Chris Lu f68e15da89 set to 404 when failed to read file id 2014-02-06 12:00:58 -08:00
Chris Lu d0147a16a9 avoid index out of range exception 2014-02-06 11:44:54 -08:00
Chris Lu 59b9fd26fc fix replication type parameter name 2014-02-06 11:44:18 -08:00
Chris Lu 6d7556b31f help message adjustment 2014-02-05 11:47:26 -08:00
Chris Lu 69a7de1ad8 optimize for submission from clustered master nodes 2014-02-05 10:49:05 -08:00
Chris Lu 0e5c4e432d report when size is closing to the volume limit
fix error
2014-02-05 10:36:37 -08:00
Chris Lu 2a8c60f71b be lenient when writing, but report right away when volume size limit is
exceeded
2014-02-05 10:22:32 -08:00
Chris Lu 2cba123474 bump up to 0.46 2014-02-05 01:55:37 -08:00
Chris Lu e7585548a4 working auto fail-over master node 2014-02-05 01:54:52 -08:00
Chris Lu d6fbd741fd a stable working clustering master node implementation 2014-02-05 00:25:23 -08:00
Chris Lu 1d5c44e2df adjust description text 2014-02-05 00:13:25 -08:00
Chris Lu af4b9c3aee go fmt 2014-02-04 01:11:28 -08:00
Chris Lu 6887e55f6a minor adjustment for weed master nodes clustering 2014-02-04 01:10:07 -08:00
Chris Lu 260fcd8e1e reduce the default volume size to 32000MB from 32768MB
this avoids problems with busy writing systems from having too many file
id assigned while the volume is close to the overflow limit.
2014-01-29 13:34:46 -08:00
Chris Lu bf56bce5e9 Issue 62: Latest raft update breaks the build 2014-01-28 11:15:24 -08:00
Chris Lu cda2a6b510 trivial refactoring 2014-01-21 20:51:46 -08:00
Chris Lu bd6e1a8a70 Issue 60: weed export -collection doesn't work 2014-01-21 20:51:07 -08:00
Chris Lu 1bf75f7f73 toughen up error handling for invalid fid 2013-12-09 13:53:24 -08:00
Chris Lu 512899e6a6 disable raft logging 2013-12-09 13:34:28 -08:00
Chris Lu da9abc2a93 a start for distributed master support, not working yet 2013-12-09 13:34:05 -08:00
Chris Lu 11e91bd549 mux router cannot handle "/" correctly. switching it off for volume
servers
2013-12-09 13:27:09 -08:00
Chris Lu 2e2f426fe2 clean up etcd backing for sequence persistent storage. It uses some OS
specific calls and is not OS-agnostic.
2013-12-03 23:30:55 -08:00
Chris Lu 5fdb1d89ce adding "server" command to start both volume server and an embedded
master server
2013-12-03 23:22:26 -08:00
Chris Lu eeeccf2f78 ssue 59: Multi Ip Enviromment support + publicUrl is disregarded by
master
2013-12-02 22:58:27 -08:00
Chris Lu e449a4a517 use glog 2013-12-02 01:59:04 -08:00
Chris Lu a234789c59 switch to glog debugging 2013-12-02 01:54:05 -08:00
Chris Lu c38eee73ca refactoring to separate master and volume server, so that these servers
can be embedded into other applications
2013-12-02 01:37:36 -08:00
Chris Lu bc2f3b26e7 refactoring, start to use gorilla/mux 2013-12-01 14:41:47 -08:00
Chris Lu 1645d3c185 avoid nil cases when error 2013-11-19 02:12:56 -08:00
Chris Lu bd0c7a3d28 comment out etcd support due to its os specific system calls 2013-11-19 01:43:16 -08:00
Chris Lu fa1bb3cee3 version 0.45! 2013-11-18 23:54:01 -08:00
Chris Lu ac66eee045 added download command to download file by fileid 2013-11-18 23:41:00 -08:00
Chris Lu 47aea42d66 fix filename not set error 2013-11-18 23:16:21 -08:00
Chris Lu 8111f7663d formatting 2013-11-18 23:04:33 -08:00
Chris Lu d0473e27d9 refactor api: lookup file id 2013-11-18 23:03:59 -08:00
Chris Lu c4a4d3609b fix duplicated file id list entries when uploading large file 2013-11-18 23:03:06 -08:00
Chris Lu 0e5e0a3754 add option to split large files into parts and then upload 2013-11-18 21:47:31 -08:00
Chris Lu aed74b5568 adjust function name 2013-11-18 15:05:11 -08:00
Chris Lu 3b68711139 support for collections! 2013-11-12 02:21:22 -08:00
Chris Lu 8f0e2f31af remove unused parameter pulse 2013-11-12 02:19:06 -08:00
Chris Lu 5eac4f043a remove a comment 2013-11-12 02:16:07 -08:00
Chris Lu 0702eee3b1 adjust logging 2013-11-10 01:47:27 -08:00
Chris Lu 1888d01fa0 adding etcd storage support for cluster meta data. Currently just
sequence. More to come...
2013-11-10 01:31:50 -08:00
Chris Lu 5cb6590eae add metastore, switching sequence to use it
metastore is for storing metadata. This will be used later when moving
to distributed master mode.
2013-11-05 01:59:00 -08:00
Chris Lu b579451db9 this is a fix important enough for a version bump 2013-10-31 12:57:32 -07:00
Chris Lu 53eacb4341 fix issue 52
keep compact section sorted when input data are not ordered
2013-10-31 12:57:06 -07:00
Chris Lu cca1df83da debug message 2013-10-31 12:56:05 -07:00
Chris Lu 3185eebf2e add test case for issue 52 2013-10-31 12:55:51 -07:00
Chris Lu 3422272a50 fix test 2013-10-31 12:55:34 -07:00
Chris Lu 9e9b2c0703 log changes 2013-10-31 12:55:19 -07:00
Chris Lu 54723c3713 Issue 51: Assign on empty cluster sometime fails under high concurrency
load

Contributed by philoops
2013-10-29 12:48:31 -07:00
Chris Lu 2637c9eac2 Merge remote-tracking branch 'origin/master'
Conflicts:
	go/topology/topology_compact.go
2013-10-17 00:28:59 -07:00
Chris Lu c43dcfa3e2 prepare for v0.43 release 2013-10-16 08:39:36 -07:00
Chris Lu 59ded34b83 issue 48 weed upload does not set the modified date 2013-10-16 08:39:09 -07:00
Chris Lu 030905714b issue 49: unwritable volume become writable after compacting 2013-10-16 08:30:29 -07:00
Chris Lu 55380a014d issue 49: unwritable volume become writable after compacting 2013-10-16 08:10:48 -07:00
Chris Lu 3f5f8657d2 add a command to force compaction of a volume, removing deleted files 2013-09-28 22:18:52 -07:00
Chris Lu 738e528329 v0.42
Changes: 
* fixed issue 45
2013-09-19 11:38:52 -07:00
Chris Lu 69ac6b6bf6 Issue 45 in weed-fs: [Compact issue] Offset overflow
New issue 45 by hieu.hcmus@gmail.com: [Compact issue] Offset overflow
http://code.google.com/p/weed-fs/issues/detail?id=45

You are using uint32(Maximum 4Gb) to store needle offset(Maximum 32Gb)
when compacting.
Currently It is ok if the volume size is < 4gb
Change variable "offset" in ScanVolumeFile function to uint64 to fix the
issue.
2013-09-19 11:06:14 -07:00
Chris Lu 82b74c7940 issue 43 "go fmt" chagnes from "Ryan S. Brown" <sb@ryansb.com>
some basic changes to parse upload url
2013-09-01 23:58:21 -07:00
Chris Lu 2e70cc8be7 default to use os.TempDir() instead of hard coded "/tmp" 2013-08-28 10:39:15 -07:00
Chris Lu 37b231b5dc Only limit input parameter to io.Reader 2013-08-14 11:31:39 -07:00
Chris Lu 8e1ac16d16 refactoring submit operation 2013-08-14 10:07:42 -07:00
Chris Lu 48e4ced29d easier for client to delete file 2013-08-14 00:31:02 -07:00
Chris Lu d5e7c1de0a refactoring code
reusable code by go clients
2013-08-13 23:26:51 -07:00
Chris Lu f7c1a15ad1 correctly print strings in error 2013-08-13 18:21:54 -07:00
Chris Lu e45c6b5e21 add white list to both master and volume servers
prepare for v0.41
2013-08-13 09:31:19 -07:00
Chris Lu 3572e1140e adjusting parameter names 2013-08-13 09:22:06 -07:00
Chris Lu 078118ecba v0.40 2013-08-12 23:48:10 -07:00
Chris Lu 11b4e0c77d fix syntax error 2013-08-12 21:43:13 -07:00
Chris Lu e0951dd44f added write whiteList, to make it a bit easier to secure volume servers
on hosting environments.
2013-08-12 21:27:47 -07:00
Chris Lu 44c4e74655 correct and more cleaner logic to fall back to read only mode
checking file permissions directly since the try and catch exception
approach does not work consistently as seen in bug #41
2013-08-12 16:53:32 -07:00
Chris Lu a74978baeb ensure unwritable volumes are not in writables list 2013-08-12 16:39:49 -07:00
Chris Lu 82f6a6838f wording change 2013-08-11 13:15:11 -07:00
Chris Lu 0deda9b638 prepare to release 0.38 2013-08-11 11:50:18 -07:00
Chris Lu 7cef280bdc handle cases when .idx files are also readonly
adjusting log level
2013-08-11 11:38:55 -07:00
Chris Lu 27f04a382a avoid changing max size 2013-08-09 00:17:07 -07:00
Chris Lu ed154053c8 switching to temporarily use glog library 2013-08-08 23:57:22 -07:00
Chris Lu b27947b355 copying from glog project. Need to adjust several APIs 2013-08-08 23:24:44 -07:00
Chris Lu c2a6012ba5 avoid verbose log message when some volumes are full 2013-08-08 15:04:00 -07:00
Chris Lu f457eef144 add /submit handler for both master and volume server 2013-08-06 13:23:10 -07:00
Chris Lu d51c8d37bd Issue 6: upload file without id specified 2013-08-06 12:13:10 -07:00
Chris Lu 952974491b refactor "content upload" out of needle creation 2013-08-06 11:23:24 -07:00
Chris Lu 54906c48f3 report errors when upload timeouts 2013-08-05 13:37:41 -07:00
Chris Lu e94d52c1af replicate mime type 2013-07-29 10:09:36 -07:00
Chris Lu fb53ec30f7 release 0.37 2013-07-28 22:54:06 -07:00
Chris Lu 8f0b527b28 a little more concise 2013-07-28 22:53:25 -07:00
Chris Lu 81debd73d4 Issue 37: Replicate delete
Reported by hieu.hcmus, Today (24 minutes ago)


What steps will reproduce the problem?
1.Create 2 volumes server same rack, replication type = 001
2.Upload a file
3.Delete file

What is the expected output? What do you see instead?
Expected output: File is deleted in both volume server
But: file is only deleted in one volume server

What version of the product are you using? On what operating system?
0.36
Please provide any additional information below.

After remove NeedleValue from NeedleMap, the size = 0 and it causes the
error.

I uploaded the patch to fix this error
2013-07-28 22:49:17 -07:00
Chris Lu 63ebafa113 fix when volume growth are partial successful in automatic mode 2013-07-24 10:31:51 -07:00
Chris Lu 3ae2eabf09 add more description to upload command 2013-07-20 15:14:12 -07:00
Chris Lu 1b3f204220 release 0.36 2013-07-20 14:53:20 -07:00
Chris Lu 123b0cc2df fix for issue #35 2013-07-19 20:38:00 -07:00
Chris Lu ff1c04c486 fix issue 34 2013-07-19 19:37:10 -07:00
Chris Lu dd2245956f better locking to prevent any possible memory access error 2013-07-15 21:34:43 -07:00
Chris Lu b409ccc5ab upload respect master default replication setting 2013-07-15 21:34:04 -07:00
Chris Lu 5e3b6e968a escaping upload file name special characters
if already gzipped, avoid gzipping again
2013-07-15 17:26:00 -07:00
Chris Lu dd66193bfb remove logging 2013-07-15 16:44:24 -07:00
Chris Lu 524a44f027 bump up the versoin 2013-07-15 16:27:11 -07:00
Chris Lu 70fe7e6b5d support gzip file upload, fix problem during replication of gzipped data 2013-07-15 11:04:43 -07:00
Chris Lu c6bd4e656e add support for http://localhost:8080/vid/key_cookie
or
http://localhost:8080/vid/key_cookie.txt
2013-07-13 23:46:12 -07:00
Chris Lu de368ef3c3 adjust usage 2013-07-13 23:19:21 -07:00
Chris Lu d9c25ccbb0 upload files recursively matching a pattern 2013-07-13 23:17:41 -07:00
Chris Lu ddf4f27a56 better error message if directory is not found 2013-07-13 22:01:48 -07:00
Chris Lu 76ba0021e5 prepare for 0.34 release 2013-07-13 19:46:26 -07:00
Chris Lu ac15868694 clean up log fmt usage. Move to log for important data changes,
warnings.
2013-07-13 19:44:24 -07:00
Chris Lu ae3245f1dc Fix a file name parsing error 2013-07-13 15:57:44 -07:00
Chris Lu 72490bc00f Consistent result format when error happens 2013-07-13 14:35:29 -07:00
Chris Lu 208ed2a991 Add support to upload a directory recursively. 2013-07-13 14:14:16 -07:00
Chris Lu 1165632fa0 use bytes.Equal() instead, Thanks for Thomas' suggestion 2013-07-13 13:51:47 -07:00
Chris Lu d4105f9b46 add support for multiple folders and multiple max limit: eg
-dir=folder1,folder2,folder3 -max=7,8,9
2013-07-13 11:38:01 -07:00
Chris Lu 175456870a bump up to 0.33 2013-07-12 14:35:29 -07:00
Chris Lu 49cc81fdab added support for /vid/keycookie/filename.txt format for HTTP GET 2013-07-12 14:19:11 -07:00
Chris Lu 4c280bc317 ensure append only for deleted files 2013-07-12 00:55:21 -07:00
Chris Lu 90018be9d2 write file info only when data is not empty 2013-07-12 00:30:45 -07:00
Chris Lu b87ec11c1c empty deleted file 2013-07-11 23:38:44 -07:00
Chris Lu b0e5112702 "weed upload" return message changes 2013-07-11 22:45:29 -07:00
Chris Lu 4c1bc99366 avoid writing the same file 2013-07-11 22:44:59 -07:00
Chris Lu db46565d18 ensure mime type checking by lower cased file name extension 2013-07-11 21:16:54 -07:00
Chris Lu 1ac71a111f Issue 28: [HELP NEEDED] weed upload does not send correct mime type to
weedfs

Fix is provided by claudiu.raveica
2013-07-11 19:14:55 -07:00
Chris Lu 3afc2d2ce6 remove unused code 2013-07-10 00:27:01 -07:00
Chris Lu 4c200acd7d 1. ensure replicated file has the same timestamp
2. upload can specify modified time by &ts=...
3. correctly return code 304
2013-07-10 00:25:14 -07:00
Chris Lu 53b6831f73 bump up version number to 0.32 2013-07-09 10:50:48 -07:00
Chris Lu cbd9d14cc4 Issue 27: feature request - Last-Modified header 2013-07-08 23:38:38 -07:00
Chris Lu 53ae13a012 change default number of volumes to 7, so that the first volume growth
would not fail.
2013-07-08 01:58:28 -07:00
Chris Lu e30e325770 Issue 26: Could not download uploaded files
Fix is provided by hieu.hcmus, He convinced me of the fix. Thanks!
2013-07-05 16:05:35 -07:00
Chris Lu d1fcf1fd67 add error when size limit is reached 2013-07-03 22:14:16 -07:00
Chris Lu 50269b74ce add dataCenter option when assign file keys
add dataCenter option when starting volume servers
some work related to freeze a volume. Not tested yet.
2013-06-19 18:10:38 -07:00
Chris Lu 715d327df0 Tamás Gulácsi contributed cdb map for read only extremely low memory
implementation.
2013-05-05 11:19:41 -07:00
Chris Lu fb635146a1 refactoring needle mapper interface to separate index file storage logic
out
2013-04-18 00:23:14 -07:00
Chris Lu 915b16f97a refactoring, same logic, but the store replication logic is moved to a
stand-alone file, for later easier improvements
2013-04-16 00:10:21 -07:00
Chris Lu e4da140d0a rename volume_location.go to volume_location_list.go 2013-04-15 15:19:14 -07:00
Chris Lu 3222d40871 fix compilation error 2013-04-14 19:37:29 -07:00
Chris Lu 95dc977608 accurate error messages during writing 2013-04-14 19:34:37 -07:00
Chris Lu a4369b35a7 merge changes from about dealing with read only volumes.
https://github.com/tgulacsi/weed-fs/commit/97482255d555f152ea99052aba7d0a0163235e39.diff
2013-04-14 19:30:26 -07:00
Chris Lu 4d8ce2fe26 adding HEAD support 2013-03-20 22:57:41 -07:00
Chris Lu 437532d559 0.31 is next release 2013-03-20 22:08:54 -07:00
Chris Lu 9da3ea35ac avoid empty data nodes 2013-03-20 05:12:55 -07:00
Chris Lu 0c75e0438e bump to 0.30 since it fixed an important bug 2013-03-20 01:39:20 -07:00
Chris Lu 1aea3512a4 return nil instead of memory access error 2013-03-20 01:23:15 -07:00
Chris Lu 6658d5de45 fix sequence assignment error 2013-03-19 13:37:36 -07:00
Chris Lu 2d0a555270 bump up the version 2013-03-19 11:28:11 -07:00
Chris Lu a1d5a6298c avoid missing configuration file error 2013-03-19 10:36:29 -07:00
Chris Lu 2d4a7ac9f9 avoid error when missing configuration file 2013-03-19 10:35:13 -07:00
Chris Lu 018df9ceb0 avoid file not exist error 2013-03-19 10:33:33 -07:00
Chris Lu a3eddde525 fix documentation error 2013-03-18 21:29:25 -07:00
Chris Lu 9bbbbb7c2c releasing version 0.28 2013-03-08 16:50:40 -08:00
Chris Lu db8e27be6e add lots of error checking by GThomas 2013-02-26 22:54:22 -08:00
Chris Lu bd278337db checking file name empty 2013-02-26 14:56:18 -08:00
Chris Lu a4cef2fbd4 only cares about error other than EOF 2013-02-11 23:54:21 -08:00
Chris Lu 91492b4947 avoid EOF error on windows. This is a "try to load" function anyway. 2013-02-11 23:38:48 -08:00
Chris Lu b395a5289b do not truncate file if any error happens. Truncating will lose all
files after this file entry.
2013-02-11 22:54:46 -08:00
Chris Lu 2ca983b6d8 print out error message 2013-02-11 22:37:13 -08:00
Chris Lu aecea22666 Issue 15: Stress test corrupts volume 2013-02-10 14:00:06 -08:00
Chris Lu 38f4425a65 checking error 2013-02-10 13:41:25 -08:00
Chris Lu 79d11ac951 go vet 2013-02-10 09:44:44 -08:00
Chris Lu d4e5a22e53 rename from cmd to weed for easier "go build" 2013-02-10 04:05:28 -08:00
Chris Lu 37a1a70cc3 remove unused files 2013-02-10 03:53:52 -08:00
Chris Lu 7743ddd7db Merge remote-tracking branch 'origin/master' 2013-02-10 03:51:04 -08:00
Chris Lu 5071f528f6 testing compilation with remove package 2013-02-10 03:49:51 -08:00
Chris Lu 7e0951ad9c testing compilation with remove package 2013-02-10 03:40:37 -08:00
Chris Lu 55f2627fcf testing new directory structure 2013-02-10 03:31:40 -08:00
Chris Lu ab6fb13ad7 avoid the "src" folder 2013-02-10 03:25:35 -08:00
Chris Lu 1b6f53cdac remove binary accidentally checked in 2013-02-10 03:12:58 -08:00
Chris Lu cb4e8ec16b re-organize code directory structure 2013-02-10 03:09:26 -08:00
Chris Lu d3b267bac2 Issue 15: Stress test corrupts volume
Checked in for GThomas(tgulacsi78)

I've also met with partial writes (pipe closed on localhost), and also
met with real corruption: after some partial write, the data size in
needle header was read as some huuuuge number, which resulted in memory
panic.

Please consider the attached patch for ensuring full writes (seeks back
to the beginning on needle append error). Hope this helps.
Tested with a small tmpfs, lot of "no space left on device" :)
(sudo umount -lf /tmp/weed; mkdir -p /tmp/weed && sudo mount -o
size=128M,mode=4777 -t tmpfs tmpfs /tmp/weed && bin/weed master
-mdir=/tmp/weed -debug=true & bin/weed volume -dir=/tmp/weed
-debug=true)

GThomas
2013-02-06 14:30:44 -08:00
Chris Lu 0b7a235c17 ensure file name does not contain any "/" 2013-01-22 15:07:51 -08:00
Chris Lu f2af477324 added file name format when exporting. patch from Tamás Gulácsi 2013-01-22 15:07:19 -08:00
Chris Lu 84e1a59df7 add option to output to stdout - patch from Tamás Gulácsi
report file size correctly
2013-01-21 17:50:10 -08:00
Chris Lu 030dde227a promptive error message 2013-01-20 20:01:59 -08:00
Chris Lu 06444b7c52 up the version to 0.28 beta 2013-01-20 19:57:45 -08:00
Chris Lu c3ef8b433c adjust text 2013-01-20 19:51:27 -08:00
Chris Lu 97556f6023 formatting 2013-01-20 19:47:04 -08:00
Chris Lu 81b9175c7a re-factoring volume file scanning code
add export function
fix bugs on deleted byte counting
2013-01-20 19:44:23 -08:00
Chris Lu f35b958d90 adding visit function for the NeedleMap 2013-01-20 11:27:32 -08:00
Chris Lu 866d15023d better error handling, check in for Gulácsi Tamás 2013-01-20 03:40:04 -08:00
Chris Lu 768eaff4b8 fix debug message error 2013-01-19 19:58:31 -08:00
Chris Lu ec7dfeeaf8 ignore compiled binary file 2013-01-19 19:50:26 -08:00
Chris Lu 921f1c626a fix debug message displaying 2013-01-19 19:49:57 -08:00
Chris Lu b0c7df0c3b go fmt for all source codes 2013-01-17 00:56:56 -08:00
Chris Lu ca9056d673 cosmetics change 2013-01-17 00:22:18 -08:00
Chris Lu 84c9ac66ac add git ignore 2013-01-17 00:17:00 -08:00
Chris Lu 50fafa3a2c Revert "sort writables to be able to skew write probability to lesser ids (older volumes)"
This reverts commit ce7394f3bf.
2013-01-17 00:15:13 -08:00
Chris Lu a502b78c3f Revert "add error return for (Un)GzipData"
This reverts commit 8243710351.
2013-01-17 00:15:09 -08:00
Chris Lu bf9c4ed033 Revert "add cmd/dump - a dumper"
This reverts commit 5d2a1e8d48.
2013-01-17 00:15:05 -08:00
Chris Lu d1494ea786 Revert "add CdbMap"
This reverts commit bf0ccf3461.
2013-01-17 00:15:01 -08:00
Chris Lu 5b49065a57 Revert "add Frozen attribute to VolumeInfo"
This reverts commit dd685fdd8d.
2013-01-17 00:14:58 -08:00
Chris Lu 3b21317863 Revert "add "freeze" subcommand to volume"
This reverts commit f262fed197.
2013-01-17 00:14:52 -08:00
Chris Lu ee08e38126 Revert "fix errors with frozen volume loading"
This reverts commit 92ffba2ab9.
2013-01-17 00:14:45 -08:00
Chris Lu be83a56bb9 Merge remote-tracking branch 'choose_remote_name/cdb' 2013-01-15 18:08:19 -08:00
Chris Lu 5f278c6bd7 move to 0.27 2013-01-14 14:23:43 -08:00
Tamás Gulácsi 92ffba2ab9 fix errors with frozen volume loading 2013-01-14 22:18:00 +01:00
Tamás Gulácsi f262fed197 add "freeze" subcommand to volume 2013-01-14 21:42:35 +01:00
Tamás Gulácsi dd685fdd8d add Frozen attribute to VolumeInfo 2013-01-13 17:07:38 +01:00
Tamás Gulácsi bf0ccf3461 add CdbMap 2013-01-12 19:56:47 +01:00
Tamás Gulácsi 5d2a1e8d48 add cmd/dump - a dumper
Walk needed to be added to NeedleMap and CompactMap, to be able to add WalkKeys and WalkValues to volume. This is needed for iterating through all the stored needles in a volume - this was dump's purpose.
2013-01-05 23:06:44 +01:00
Tamás Gulácsi 8243710351 add error return for (Un)GzipData 2013-01-04 23:33:07 +01:00
Tamás Gulácsi ce7394f3bf sort writables to be able to skew write probability to lesser ids (older volumes) 2013-01-04 22:49:40 +01:00
Chris Lu 8fb8ebdf14 master can redirect GET/DELETE/POST requests to volume servers. So
clients does not always need to remember the volume server locations.
This is good for low~medium sized web site traffic.
2013-01-04 01:02:52 -08:00
Chris Lu e9eb8949ba set to beta version for 0.27 2013-01-02 15:41:43 -08:00
Chris Lu 3c8dd8592a compare read file size with in-memory file size 2013-01-02 15:39:55 -08:00
Chris Lu c35fe9d631 escape file name when there is a quote inside 2013-01-02 13:40:00 -08:00
Chris Lu 018f0b73be properly handle quick volume server restart 2012-12-22 16:26:02 -08:00
Chris Lu 264678c9b1 Default more not to gzip since gzip can be done on client side. 2012-12-22 13:15:09 -08:00
Chris Lu 46b8c4cc98 use bits in needle.Flags to mark hasName and hasMime 2012-12-22 12:38:09 -08:00
Chris Lu 9b95430e9f add store metadata:file name, mime type, is_gzipped
add support to upload .gz file directly
2012-12-22 02:10:45 -08:00
Chris Lu 37afb31d05 parallel logic for read and write 2012-12-21 02:20:38 -08:00
Chris Lu 315879ce47 fix write error 2012-12-21 02:15:29 -08:00
Chris Lu 1943647860 can read/write files in format version 2 2012-12-21 02:13:02 -08:00
Chris Lu 11cc489ca5 refactoring 2012-12-21 00:36:55 -08:00
Chris Lu 79a49ada39 refactor for reading super block 2012-12-20 22:32:21 -08:00
Chris Lu ebe7af1833 refactor a bit 2012-12-20 21:57:03 -08:00
Chris Lu ab5e9727a9 reading/setting/reporting correct volume version 2012-12-17 17:51:39 -08:00
Chris Lu 6c8810e4d2 ensure only compatible volume versions are writable 2012-12-17 16:48:54 -08:00
Chris Lu 8af7906b3d better log message 2012-12-17 01:17:06 -08:00
Chris Lu 6201ed537e reporting volume size as early as possible 2012-12-03 22:54:08 -08:00
Chris Lu b3df7673ed move to 0.25, previous 0.23 and 0.24 are not correct when managing the
volumes
2012-12-03 21:31:12 -08:00
Chris Lu 7e83a75fba correctly count volumes, to ensure proper capacity management 2012-12-03 21:27:57 -08:00
Chris Lu e19edccf3a ensure properly make volume unwritable. Previously passing volumeInfo
reference, causing make wrong volumes unwritable!
2012-12-03 20:28:12 -08:00
Chris Lu 2deee3f47c added proper log messages 2012-11-26 13:12:21 -08:00
Chris Lu 2add211a86 adjust default read timeout to 3 seconds 2012-11-26 12:38:35 -08:00
Chris Lu 8b60de622e fix compilation error 2012-11-23 18:14:28 -08:00
Chris Lu fa61bb1867 remove log message 2012-11-23 18:07:43 -08:00
Chris Lu 3ef7a34f49 add command line option to control garbage threshold 2012-11-23 17:31:54 -08:00
Chris Lu 94dbe60233 periodically compact volumes 2012-11-23 17:03:27 -08:00
Chris Lu 5e020196f6 add version type 2012-11-21 10:52:08 -08:00
Chris Lu 5dc509c6e4 cleaner code, better error handling 2012-11-20 01:45:36 -08:00
Chris Lu e00d8dc536 adjust formatting 2012-11-20 00:54:37 -08:00
Chris Lu 084e0ab7bb adding exception handling for this case 2012-11-20 00:42:45 -08:00
Chris Lu f5a8382933 add warning message 2012-11-13 12:13:59 -08:00
Chris Lu 9782ace1bd add locking when adjusting topology 2012-11-13 12:13:40 -08:00
Chris Lu 6f606bb350 better error message 2012-11-13 12:13:12 -08:00
Chris Lu b23e51f205 remove debug message 2012-11-12 11:07:03 -08:00
Chris Lu 166a5fc524 Issue 11: Failed to write to replicas for volumen 3
Fix displaying wrong error message
2012-11-12 10:50:25 -08:00
Chris Lu ecd0399f8d Issue 11: Failed to write to replicas for volumen 3
Avoid unnecessary master lookup
2012-11-12 01:26:18 -08:00
Chris Lu ccab4217e4 comment change: 3 times of the pulse 2012-11-11 22:37:12 -08:00
Chris Lu 01f2fcf72d remove comments 2012-11-09 15:40:28 -08:00
Chris Lu 86c8f248bd support compacting a volume 2012-11-07 01:51:43 -08:00
Chris Lu 9630825576 adjusting gzip logic 2012-10-23 10:59:40 -07:00
Chris Lu 6f7b0cafee adjust time_wait to 1 second 2012-10-15 02:09:47 -07:00
Chris Lu 3aefea0fe2 show volume status 2012-10-10 01:10:05 -07:00
Chris Lu 1d0be87e0e Merge remote-tracking branch 'origin/master'
Conflicts:
	weed-fs/src/cmd/weed/master.go
2012-10-09 21:10:47 -07:00
Chris Lu ce615b4e6f setting http status code for failed requests 2012-10-09 21:06:24 -07:00
Chris Lu 8c2c5986c8 setting http status code for failed requests 2012-10-09 21:03:22 -07:00
Chris Lu 6b1e60582c adding file count and deletion count 2012-10-09 20:53:31 -07:00
Chris Lu 8e25cc74d1 Merge remote-tracking branch 'origin/master' 2012-10-06 10:57:42 -07:00
Chris Lu c8eb9a7542 fix compilation error 2012-10-06 10:56:43 -07:00
Chris Lu be952035c7 bump up version 2012-10-06 10:51:45 -07:00
Chris Lu ba55296b18 optionally change the maximun number of CPUs 2012-10-06 10:50:52 -07:00
Chris Lu 45a6323a4b bump up version 2012-09-30 02:21:20 -07:00
Chris Lu 6ce41e30a4 change to 3-digit replication types 2012-09-30 02:20:33 -07:00
Chris Lu 2fe4371899 change to a more memory efficient map, implemented by several lists of
<key,offset,size>
2012-09-29 16:07:24 -07:00
Chris Lu 3a6c37aa6c configurable read timeout 2012-09-28 10:21:06 -07:00
Chris Lu 4c7eb645a1 adjusting default read timeout to 5 seconds, same as apache default
value
2012-09-28 10:15:39 -07:00
Chris Lu d2dd7d1694 add 30 seconds http read timeout 2012-09-28 09:13:17 -07:00
Chris Lu 819de58197 add pretty print to json outputs 2012-09-28 09:12:36 -07:00
Chris Lu 98022f2b3d use NeedleValue directly instead of additional pointer, to reduce memory
usage
2012-09-27 21:46:32 -07:00
Chris Lu 5cb38f9ea7 use one-liner debug(messages) 2012-09-27 12:17:27 -07:00
Chris Lu 2fd6b65a9e add versioning 2012-09-26 20:35:14 -07:00
Chris Lu 33d5778a46 cleaner error message 2012-09-26 20:30:05 -07:00
Chris Lu 46d13f6b5e clean up unused options
cleaning error handling
2012-09-26 14:57:21 -07:00
Chris Lu 20706d8cf2 more error handling 2012-09-26 14:28:46 -07:00
Chris Lu a847e2beee better error reporting and handling 2012-09-26 13:38:45 -07:00
Chris Lu 3d53f73006 remove old comments 2012-09-26 10:55:09 -07:00
Chris Lu 4b3676a54b delete replications, untested yet 2012-09-26 03:27:10 -07:00
Chris Lu b5c29e25aa fix 2012-09-26 02:34:43 -07:00
Chris Lu 5d86b50782 fixes 2012-09-26 02:29:16 -07:00
Chris Lu d63c5231ac url error 2012-09-26 02:02:15 -07:00
Chris Lu 7ee12f14a8 add option to set server's ip address 2012-09-26 01:55:56 -07:00
Chris Lu 019173b1cc adjusting error message printing 2012-09-25 23:28:16 -07:00
Chris Lu 59ca65da3c error handling 2012-09-25 16:05:31 -07:00
Chris Lu ac5f227aae correct crc
correct volume id lookup
2012-09-25 15:37:13 -07:00
Chris Lu ca8c8a56b7 adjusting tests 2012-09-24 02:25:31 -07:00
Chris Lu 729340708e adjusting version 2012-09-24 02:02:42 -07:00
Chris Lu e340fbee82 removing set volume location
display version number
add default replication type
2012-09-24 02:01:53 -07:00
Chris Lu df74f538f7 adjusting http status code for creation
switch to new lookup implementation
2012-09-23 15:45:26 -07:00
Chris Lu 2002111a80 removing volume list 2012-09-23 14:51:25 -07:00
Chris Lu d89371af99 change default configuration file location 2012-09-23 02:52:04 -07:00
Chris Lu 73dbb3aed9 load configuration file, with topology configured 2012-09-22 20:46:31 -07:00
Chris Lu a34570fc5b read topology configuration 2012-09-22 00:01:13 -07:00
Chris Lu e986dcf5e0 adjusting testing 2012-09-21 01:31:52 -07:00
Chris Lu d056c622bf refactoring 2012-09-21 01:30:31 -07:00
Chris Lu 77c0de914a now any data node can accept storing files
files are automatically copied to replicas
2012-09-20 21:03:40 -07:00
Chris Lu 08dcf2f035 refactoring allocate_volume operation 2012-09-20 18:02:56 -07:00
Chris Lu 5e97179d06 refactoring content uploading 2012-09-20 17:58:29 -07:00
Chris Lu 7d8e9f829c more error messages 2012-09-20 02:53:23 -07:00
Chris Lu 462f2ed958 for moved volumes, redirect with code 501 2012-09-20 02:47:32 -07:00
Chris Lu a1bc529db6 lots of fix
1. sending 404 if not found
2. handle node-up/node-down/changing-max/volume-become-full
2012-09-20 02:11:08 -07:00
Chris Lu eae0080d75 adjusting parameter name 2012-09-19 16:56:35 -07:00
Chris Lu fc9f1da143 handle volume server up/down events 2012-09-19 16:48:04 -07:00
Chris Lu e19fd68f18 working now to start/stop volume servers 2012-09-19 01:45:30 -07:00
Chris Lu f3da0906ed channel based visitor pattern 2012-09-18 14:05:12 -07:00
Chris Lu b0e250d437 adjusting refresh topology writable volumes(not finished yet)
Need to refreshWritableVolumes for each replication type
2012-09-17 01:48:09 -07:00
Chris Lu 6671f576cb adjusting log messages 2012-09-16 23:21:18 -07:00
Chris Lu 4846a7232e adjusting return messages for growing volumes 2012-09-16 23:18:47 -07:00
Chris Lu 15ced2398e adjusting maxVolumeCount if volume server changes it 2012-09-16 19:18:37 -07:00
Chris Lu 9b99240584 can auto grow 00 and 01 replication volumes 2012-09-16 17:31:15 -07:00
Chris Lu e7c4ee1c64 register reported topology 2012-09-14 01:17:13 -07:00
Chris Lu b5ac55f012 detect existing volumes 2012-09-13 01:38:27 -07:00
Chris Lu 6892842021 verify adding columes should work well 2012-09-13 01:33:47 -07:00
Chris Lu 9e0f8d9f0d remote assigns volume to volume server 2012-09-13 00:04:56 -07:00
Chris Lu 4a7833f1bf replication related work 2012-09-12 01:07:23 -07:00
Chris Lu e4c0693b03 replication related work on data nodes 2012-09-10 17:08:52 -07:00
Chris Lu 6daf221937 volume layout for each replication level 2012-09-10 00:18:07 -07:00
Chris Lu 8684b0999d file renaming 2012-09-08 16:43:43 -07:00
Chris Lu 9f4630736d rename Server to DataNode
formatting
2012-09-08 16:25:44 -07:00
Chris Lu 9bde067f16 add comments 2012-09-08 00:05:58 -07:00
Chris Lu a7d8d46306 avoid null in json response 2012-09-04 00:34:28 -07:00
Chris Lu a74f6cf593 change to vid~machines mapping 2012-09-04 00:26:38 -07:00
Chris Lu 85a1b419c0 handling lost servers 2012-09-03 21:31:13 -07:00
Chris Lu 0349199d0e 0.18 release 2012-09-03 20:41:48 -07:00
Chris Lu 03aa23fb1b fixing help message printing 2012-09-03 20:40:38 -07:00
Chris Lu a56a523f29 refactoring 2012-09-03 19:36:35 -07:00
Chris Lu fbe828e486 reformatting 2012-09-03 19:18:02 -07:00
Chris Lu 09542d82b4 refactoring, clean up, v0.17 2012-09-03 15:41:24 -07:00
Chris Lu cdd64a8099 dc and rack aware volume allocation 2012-09-03 01:50:04 -07:00
Chris Lu 1a2ff0514c Merge branch 'master' of https://code.google.com/p/weed-fs/
Conflicts:
	weed-fs/src/pkg/topology/node.go
	weed-fs/src/pkg/topology/server.go
	weed-fs/src/pkg/topology/topo_test.go
	weed-fs/src/pkg/topology/topology.go
2012-09-02 14:55:00 -07:00
Chris Lu b95c9860ed interface and default implementation for node 2012-09-02 14:33:48 -07:00
Chris Lu 6a84f50d24 interface and default implementation for node 2012-09-02 11:36:23 -07:00
Chris Lu a467d5081c adjusted tests 2012-09-01 13:17:30 -07:00
Chris Lu c51884ce23 remove extra code 2012-09-01 10:54:41 -07:00
Chris Lu 1760dd083d remove reservedVolumeCount to simplify volume allocation logic 2012-09-01 10:51:07 -07:00
Chris Lu c48bda0232 return the node during assigning free volume 2012-09-01 02:43:43 -07:00
Chris Lu 7a30a48027 assign a free volume randomly 2012-09-01 02:20:59 -07:00
Chris Lu 8d0ea07f5f loading from json setup in tests 2012-08-31 01:35:11 -07:00
Chris Lu f5d981ab4d scaffold for tests 2012-08-29 01:42:24 -07:00
Chris Lu 317e12644a reserve a volume
add VolumeId.Next()
2012-08-29 01:37:40 -07:00
Chris Lu f7adf1687f reduce duplicated code by using a tree of Node 2012-08-29 00:58:03 -07:00
Chris Lu 97e4a1d6eb add code to randomly select one new volume to grow 2012-08-28 01:04:39 -07:00
Chris Lu 2dceb44ae4 add more for volume placement
fix possible nil volume cases
2012-08-27 13:52:02 -07:00
Chris Lu c72f10511a Merge branch 'master' of https://code.google.com/p/weed-fs/ 2012-08-24 01:21:06 -07:00
Chris Lu 58087bc64f ignore files 2012-08-24 01:17:20 -07:00
Chris Lu 09ed882e5f clean log 2012-08-24 01:15:27 -07:00
Chris Lu 8f9e84bca0 clean log 2012-08-24 01:14:44 -07:00
Chris Lu 869a6711bc change data center id from integer to string 2012-08-23 23:35:30 -07:00
Chris Lu 9b4ce65882 simplify volume.go file 2012-08-23 23:24:32 -07:00
Chris Lu 0c32e2e965 simplify volume id printing 2012-08-23 23:14:54 -07:00
Chris Lu 868e47f994 remove unused test 2012-08-23 23:07:46 -07:00
Chris Lu b820609088 change name: needle id instead of needle key 2012-08-23 23:06:15 -07:00
Chris Lu 9f92f2779d adjusting for types 2012-08-23 22:56:14 -07:00
Chris Lu 5e3ecc1b82 adding VolumeId type 2012-08-23 22:46:54 -07:00
Chris Lu 03f4c0b832 adding topology related types 2012-08-23 22:33:37 -07:00
Chris Lu 31e4dbfe38 change volume id type to topology.VolumeId 2012-08-23 22:20:37 -07:00
Chris Lu 0121f35c12 starting a shell 2012-08-23 20:56:09 -07:00
Chris Lu 0109cc0e30 correct wording 2012-08-23 19:13:14 -07:00
Chris Lu 5caa7bbdc9 refactoring only 2012-08-23 19:10:55 -07:00
chris.lu@gmail.com 10c2a4540e v0.16
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@67 282b0af5-e82d-9cf1-ede4-77906d7719d0
2012-08-07 08:33:13 +00:00
chris.lu@gmail.com aab5390cb5 all switching to "weed command [args]" usage mode
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@66 282b0af5-e82d-9cf1-ede4-77906d7719d0
2012-08-07 08:31:48 +00:00
chris.lu@gmail.com 85da309eed all switching to "weed command [args]" usage mode
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@65 282b0af5-e82d-9cf1-ede4-77906d7719d0
2012-08-07 08:31:22 +00:00
chris.lu@gmail.com 5e9dc0e668 all switching to "weed command [args]" usage mode
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@64 282b0af5-e82d-9cf1-ede4-77906d7719d0
2012-08-07 08:29:22 +00:00
chris.lu@gmail.com 3f1136c194 migrate fix command
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@63 282b0af5-e82d-9cf1-ede4-77906d7719d0
2012-08-07 01:20:26 +00:00
chris.lu@gmail.com 51860424a6 moving to go style commands
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@62 282b0af5-e82d-9cf1-ede4-77906d7719d0
2012-08-06 23:54:53 +00:00
chris.lu@gmail.com c627942691 adding uncompressing support!
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@61 282b0af5-e82d-9cf1-ede4-77906d7719d0
2012-07-30 08:52:11 +00:00
chris.lu@gmail.com 50c3f1d4a7 adding compressiong support!
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@60 282b0af5-e82d-9cf1-ede4-77906d7719d0
2012-07-30 08:37:10 +00:00
chris.lu@gmail.com f3a4125ee7 adding compressiong support!
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@59 282b0af5-e82d-9cf1-ede4-77906d7719d0
2012-07-30 08:36:25 +00:00
chris.lu@gmail.com 2e1ffa189b The extension ext should begin with a leading dot, as in ".html"
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@58 282b0af5-e82d-9cf1-ede4-77906d7719d0
2012-07-30 07:28:06 +00:00
chris.lu@gmail.com 2af8c354a7 git-svn-id: https://weed-fs.googlecode.com/svn/trunk@57 282b0af5-e82d-9cf1-ede4-77906d7719d0 2012-07-17 05:07:19 +00:00
chris.lu@gmail.com 577bbcb2e3 convenient tool to submit serveral versions of the same file
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@56 282b0af5-e82d-9cf1-ede4-77906d7719d0
2012-07-17 04:11:38 +00:00
chris.lu@gmail.com 008b3fbbc9 remove debug message
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@55 282b0af5-e82d-9cf1-ede4-77906d7719d0
2012-07-17 04:10:54 +00:00
chris.lu@gmail.com d46e588200 simplify delta of file id, for multi-versioning of a file
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@54 282b0af5-e82d-9cf1-ede4-77906d7719d0
2012-07-16 17:15:16 +00:00
chris.lu@gmail.com eb9456d7d5 handle special case when browser also asks for favicon.ico
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@53 282b0af5-e82d-9cf1-ede4-77906d7719d0
2012-07-16 07:41:39 +00:00
chris.lu@gmail.com bcffffbc5e add capability to assign a batch of file ids
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@51 282b0af5-e82d-9cf1-ede4-77906d7719d0
2012-07-16 04:33:21 +00:00
chris.lu@gmail.com 68a216586f add capability to assign a batch of file ids
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@50 282b0af5-e82d-9cf1-ede4-77906d7719d0
2012-07-16 04:12:42 +00:00
chris.lu@gmail.com 74989d69c9 add error handling when non-multipart request comes in
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@49 282b0af5-e82d-9cf1-ede4-77906d7719d0
2012-07-03 06:46:26 +00:00
chris.lu@gmail.com de6e1442d7 also return publicUrl when assigning the fid
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@48 282b0af5-e82d-9cf1-ede4-77906d7719d0
2012-06-30 09:14:51 +00:00
chris.lu@gmail.com 8aba24a3f8 git-svn-id: https://weed-fs.googlecode.com/svn/trunk@47 282b0af5-e82d-9cf1-ede4-77906d7719d0 2012-06-29 07:55:33 +00:00
chris.lu@gmail.com bb01324482 compatible with Go1
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@46 282b0af5-e82d-9cf1-ede4-77906d7719d0
2012-06-29 07:53:47 +00:00
chris.lu@gmail.com 8edf12f026 fix test
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@45 282b0af5-e82d-9cf1-ede4-77906d7719d0
2012-03-29 21:47:52 +00:00
chris.lu@gmail.com 4c31b6d533 delete entry from file index also
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@44 282b0af5-e82d-9cf1-ede4-77906d7719d0
2012-01-19 18:28:54 +00:00
chris.lu@gmail.com 3c7c85b1d4 remove verbose logging
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@43 282b0af5-e82d-9cf1-ede4-77906d7719d0
2012-01-19 18:28:33 +00:00
chris.lu@gmail.com 659bf1940f correctly deleting a file
correctly setting volume file size limit

git-svn-id: https://weed-fs.googlecode.com/svn/trunk@42 282b0af5-e82d-9cf1-ede4-77906d7719d0
2012-01-19 00:49:41 +00:00
chris.lu@gmail.com 380953692b generating makefiles from a newer version of gb
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@41 282b0af5-e82d-9cf1-ede4-77906d7719d0
2012-01-18 22:59:33 +00:00
chris.lu@gmail.com 50b1eff390 add usage instructions
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@40 282b0af5-e82d-9cf1-ede4-77906d7719d0
2012-01-02 01:20:12 +00:00
chris.lu@gmail.com 10511fc54c adding makefiles created by go-gb
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@39 282b0af5-e82d-9cf1-ede4-77906d7719d0
2012-01-02 00:57:55 +00:00
chris.lu@gmail.com 563902cda5 git-svn-id: https://weed-fs.googlecode.com/svn/trunk@38 282b0af5-e82d-9cf1-ede4-77906d7719d0 2012-01-02 00:56:58 +00:00
chris.lu@gmail.com c8af490fb0 adding makefiles created by go-gb
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@37 282b0af5-e82d-9cf1-ede4-77906d7719d0
2012-01-02 00:53:19 +00:00
chris.lu@gmail.com 0701286243 adding makefiles created by go-gb
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@36 282b0af5-e82d-9cf1-ede4-77906d7719d0
2012-01-02 00:52:43 +00:00
chris.lu@gmail.com 97a1d587d4 adding makefiles created by go-gb
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@35 282b0af5-e82d-9cf1-ede4-77906d7719d0
2012-01-02 00:45:32 +00:00
chris.lu@gmail.com 4c2ca916ec fix enforcing volume size limit
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@34 282b0af5-e82d-9cf1-ede4-77906d7719d0
2011-12-29 08:07:19 +00:00
chris.lu@gmail.com 298fdb4603 add configurable volume size limit
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@33 282b0af5-e82d-9cf1-ede4-77906d7719d0
2011-12-29 01:57:02 +00:00
chris.lu@gmail.com 0eff4311f5 add more error handling, adjust volume size to 32G
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@32 282b0af5-e82d-9cf1-ede4-77906d7719d0
2011-12-29 01:46:38 +00:00
chris.lu@gmail.com 2ccc098882 better error messages
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@31 282b0af5-e82d-9cf1-ede4-77906d7719d0
2011-12-28 20:31:13 +00:00
chris.lu@gmail.com 60c17068a6 correct sequence generating
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@30 282b0af5-e82d-9cf1-ede4-77906d7719d0
2011-12-27 06:09:21 +00:00
chris.lu@gmail.com b2f4a4e739 adjust weedc heartbeat to be randomly between (1*pulse, 2*pulse) seconds
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@29 282b0af5-e82d-9cf1-ede4-77906d7719d0
2011-12-27 01:51:18 +00:00
chris.lu@gmail.com 3c98f1a119 better log messages
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@28 282b0af5-e82d-9cf1-ede4-77906d7719d0
2011-12-27 01:40:16 +00:00
chris.lu@gmail.com 4c36190dd3 rename weedc option name to publicUrl
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@27 282b0af5-e82d-9cf1-ede4-77906d7719d0
2011-12-26 10:07:53 +00:00
chris.lu@gmail.com c27f6175d7 update volume status on each heartbeat
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@26 282b0af5-e82d-9cf1-ede4-77906d7719d0
2011-12-26 09:58:07 +00:00
chris.lu@gmail.com 6913fabc64 simplifying volume id mechanism, removing automatic volume id generation and discovering
periodically report machine status

git-svn-id: https://weed-fs.googlecode.com/svn/trunk@25 282b0af5-e82d-9cf1-ede4-77906d7719d0
2011-12-26 09:43:17 +00:00
chris.lu@gmail.com ae3a53388f refactoring code
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@24 282b0af5-e82d-9cf1-ede4-77906d7719d0
2011-12-25 05:30:57 +00:00
chris.lu@gmail.com 6813f118d4 get and delete now checks cookie
adding super block
adding tool to fix volume index

git-svn-id: https://weed-fs.googlecode.com/svn/trunk@23 282b0af5-e82d-9cf1-ede4-77906d7719d0
2011-12-24 08:40:56 +00:00
chris.lu@gmail.com cf7094f3c9 return written bytes, add debug mode
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@22 282b0af5-e82d-9cf1-ede4-77906d7719d0
2011-12-24 01:25:22 +00:00
chris.lu@gmail.com cc8af2e7dc print error message if invalid file id is used
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@21 282b0af5-e82d-9cf1-ede4-77906d7719d0
2011-12-22 19:55:13 +00:00
chris.lu@gmail.com ea75165e85 works now!
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@20 282b0af5-e82d-9cf1-ede4-77906d7719d0
2011-12-22 04:04:47 +00:00
chris.lu@gmail.com 9c6a9bf518 simplify the file id format
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@19 282b0af5-e82d-9cf1-ede4-77906d7719d0
2011-12-20 09:00:01 +00:00
chris.lu@gmail.com a657eec299 use uint64, instead of key+alternativeKey, as file id
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@18 282b0af5-e82d-9cf1-ede4-77906d7719d0
2011-12-20 02:34:53 +00:00
chris.lu@gmail.com d018809830 efficiently assign file id
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@17 282b0af5-e82d-9cf1-ede4-77906d7719d0
2011-12-19 09:18:13 +00:00
chris.lu@gmail.com b39d1a77b4 cleaner
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@16 282b0af5-e82d-9cf1-ede4-77906d7719d0
2011-12-19 05:59:37 +00:00
chris.lu@gmail.com 041a93887c now join, status, read, write for weed server are working!
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@15 282b0af5-e82d-9cf1-ede4-77906d7719d0
2011-12-18 10:35:59 +00:00
chris.lu@gmail.com 2c7a4eea1f simplified to one machine per volume
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@14 282b0af5-e82d-9cf1-ede4-77906d7719d0
2011-12-18 07:22:04 +00:00
chris.lu@gmail.com 1fed603df9 now working for registering volume id ~ machine mapping
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@13 282b0af5-e82d-9cf1-ede4-77906d7719d0
2011-12-17 06:50:51 +00:00
chris.lu@gmail.com 10930ce6b6 git-svn-id: https://weed-fs.googlecode.com/svn/trunk@12 282b0af5-e82d-9cf1-ede4-77906d7719d0 2011-12-17 06:47:23 +00:00
chris.lu@gmail.com 25d0caa901 git-svn-id: https://weed-fs.googlecode.com/svn/trunk@11 282b0af5-e82d-9cf1-ede4-77906d7719d0 2011-12-16 15:06:58 +00:00
chris.lu@gmail.com 4d7884ca65 git-svn-id: https://weed-fs.googlecode.com/svn/trunk@10 282b0af5-e82d-9cf1-ede4-77906d7719d0 2011-12-16 15:00:05 +00:00
chris.lu@gmail.com 23ecd7bb33 split into server and clients
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@9 282b0af5-e82d-9cf1-ede4-77906d7719d0
2011-12-16 14:51:26 +00:00
chris.lu@gmail.com 02f4e7b82c split into server and clients
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@8 282b0af5-e82d-9cf1-ede4-77906d7719d0
2011-12-16 14:51:15 +00:00
chris.lu@gmail.com 5381479177 git-svn-id: https://weed-fs.googlecode.com/svn/trunk@7 282b0af5-e82d-9cf1-ede4-77906d7719d0 2011-12-13 00:17:36 +00:00
chris.lu@gmail.com 2858701e6c git-svn-id: https://weed-fs.googlecode.com/svn/trunk@6 282b0af5-e82d-9cf1-ede4-77906d7719d0 2011-12-11 20:48:01 +00:00
chris.lu@gmail.com 70be76735c git-svn-id: https://weed-fs.googlecode.com/svn/trunk@5 282b0af5-e82d-9cf1-ede4-77906d7719d0 2011-12-11 09:30:09 +00:00
chris.lu@gmail.com da97f86447 git-svn-id: https://weed-fs.googlecode.com/svn/trunk@4 282b0af5-e82d-9cf1-ede4-77906d7719d0 2011-12-11 08:42:21 +00:00
chris.lu@gmail.com 8fade18e40 store is sort of working
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@3 282b0af5-e82d-9cf1-ede4-77906d7719d0
2011-11-30 02:18:15 +00:00
chris.lu@gmail.com 4f362fe883 Share project "weed-fs" into "https://weed-fs.googlecode.com/svn/trunk"
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@2 282b0af5-e82d-9cf1-ede4-77906d7719d0
2011-11-30 02:16:20 +00:00
(no author) 48357c529c Initial directory structure.
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@1 282b0af5-e82d-9cf1-ede4-77906d7719d0
2011-11-30 01:53:09 +00:00
3837 changed files with 21349 additions and 621120 deletions

No files matched your search

+79
View File
@@ -0,0 +1,79 @@
.goxc*
vendor
tags
*.swp
### OSX template
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio
*.iml
## Directory-based project format:
.idea/
# if you remove the above rule, at least ignore the following:
# User-specific stuff:
# .idea/workspace.xml
# .idea/tasks.xml
# .idea/dictionaries
# Sensitive or high-churn files:
# .idea/dataSources.ids
# .idea/dataSources.xml
# .idea/sqlDataSources.xml
# .idea/dynamic.xml
# .idea/uiDesigner.xml
# Gradle:
# .idea/gradle.xml
# .idea/libraries
# Mongo Explorer plugin:
# .idea/mongoSettings.xml
## File-based project format:
*.ipr
*.iws
## Plugin-specific files:
# IntelliJ
/out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
test_data
build
+13
View File
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>seaweedfs</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
<nature>goclipse.goNature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
</natures>
</projectDescription>
+44
View File
@@ -0,0 +1,44 @@
sudo: false
language: go
go:
- 1.7
- 1.8.3
- tip
before_install:
- export PATH=/home/travis/gopath/bin:$PATH
install:
- go get ./weed/...
script:
- go test ./weed/...
before_deploy:
- make release
deploy:
provider: releases
skip_cleanup: true
api_key:
secure: ERL986+ncQ8lwAJUYDrQ8s2/FxF/cyNIwJIFCqspnWxQgGNNyokET9HapmlPSxjpFRF0q6L2WCg9OY3mSVRq4oI6hg1igOQ12KlLyN71XSJ3c8w0Ay5ho48TQ9l3f3Iu97mntBCe9l0R9pnT8wj1VI8YJxloXwUMG2yeTjA9aBI=
file:
- build/linux_arm.tar.gz
- build/linux_arm64.tar.gz
- build/linux_386.tar.gz
- build/linux_amd64.tar.gz
- build/darwin_amd64.tar.gz
- build/windows_386.zip
- build/windows_amd64.zip
- build/freebsd_arm.tar.gz
- build/freebsd_amd64.tar.gz
- build/freebsd_386.tar.gz
- build/netbsd_arm.tar.gz
- build/netbsd_amd64.tar.gz
- build/netbsd_386.tar.gz
- build/openbsd_arm.tar.gz
- build/openbsd_amd64.tar.gz
- build/openbsd_386.tar.gz
on:
tags: true
repo: chrislusf/seaweedfs
go: tip
+6
View File
@@ -0,0 +1,6 @@
FROM cydev/go
RUN go get github.com/chrislusf/seaweedfs/weed
EXPOSE 8080
EXPOSE 9333
VOLUME /data
ENTRYPOINT ["weed"]
+3 -3
View File
@@ -178,7 +178,7 @@
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
@@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Copyright 2016 Chris Lu
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -198,4 +198,4 @@
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
+113
View File
@@ -0,0 +1,113 @@
BINARY = weed/weed
package = github.com/chrislusf/seaweedfs/weed
GO_FLAGS = #-v
SOURCE_DIR = ./weed/
appname := weed
sources := $(wildcard *.go)
build = GOOS=$(1) GOARCH=$(2) go build -o build/$(appname)$(3) $(SOURCE_DIR)
tar = cd build && tar -cvzf $(1)_$(2).tar.gz $(appname)$(3) && rm $(appname)$(3)
zip = cd build && zip $(1)_$(2).zip $(appname)$(3) && rm $(appname)$(3)
all: build
.PHONY : clean deps build linux release windows_build darwin_build linux_build bsd_build clean
clean:
go clean -i $(GO_FLAGS) $(SOURCE_DIR)
rm -f $(BINARY)
rm -rf build/
deps:
go get $(GO_FLAGS) -d $(SOURCE_DIR)
build: deps
go build $(GO_FLAGS) -o $(BINARY) $(SOURCE_DIR)
linux: deps
mkdir -p linux
GOOS=linux GOARCH=amd64 go build $(GO_FLAGS) -o linux/$(BINARY) $(SOURCE_DIR)
release: deps windows_build darwin_build linux_build bsd_build
##### LINUX BUILDS #####
linux_build: build/linux_arm.tar.gz build/linux_arm64.tar.gz build/linux_386.tar.gz build/linux_amd64.tar.gz
build/linux_386.tar.gz: $(sources)
$(call build,linux,386,)
$(call tar,linux,386)
build/linux_amd64.tar.gz: $(sources)
$(call build,linux,amd64,)
$(call tar,linux,amd64)
build/linux_arm.tar.gz: $(sources)
$(call build,linux,arm,)
$(call tar,linux,arm)
build/linux_arm64.tar.gz: $(sources)
$(call build,linux,arm64,)
$(call tar,linux,arm64)
##### DARWIN (MAC) BUILDS #####
darwin_build: build/darwin_amd64.tar.gz
build/darwin_amd64.tar.gz: $(sources)
$(call build,darwin,amd64,)
$(call tar,darwin,amd64)
##### WINDOWS BUILDS #####
windows_build: build/windows_386.zip build/windows_amd64.zip
build/windows_386.zip: $(sources)
$(call build,windows,386,.exe)
$(call zip,windows,386,.exe)
build/windows_amd64.zip: $(sources)
$(call build,windows,amd64,.exe)
$(call zip,windows,amd64,.exe)
##### BSD BUILDS #####
bsd_build: build/freebsd_arm.tar.gz build/freebsd_386.tar.gz build/freebsd_amd64.tar.gz \
build/netbsd_arm.tar.gz build/netbsd_386.tar.gz build/netbsd_amd64.tar.gz \
build/openbsd_arm.tar.gz build/openbsd_386.tar.gz build/openbsd_amd64.tar.gz
build/freebsd_386.tar.gz: $(sources)
$(call build,freebsd,386,)
$(call tar,freebsd,386)
build/freebsd_amd64.tar.gz: $(sources)
$(call build,freebsd,amd64,)
$(call tar,freebsd,amd64)
build/freebsd_arm.tar.gz: $(sources)
$(call build,freebsd,arm,)
$(call tar,freebsd,arm)
build/netbsd_386.tar.gz: $(sources)
$(call build,netbsd,386,)
$(call tar,netbsd,386)
build/netbsd_amd64.tar.gz: $(sources)
$(call build,netbsd,amd64,)
$(call tar,netbsd,amd64)
build/netbsd_arm.tar.gz: $(sources)
$(call build,netbsd,arm,)
$(call tar,netbsd,arm)
build/openbsd_386.tar.gz: $(sources)
$(call build,openbsd,386,)
$(call tar,openbsd,386)
build/openbsd_amd64.tar.gz: $(sources)
$(call build,openbsd,amd64,)
$(call tar,openbsd,amd64)
build/openbsd_arm.tar.gz: $(sources)
$(call build,openbsd,arm,)
$(call tar,openbsd,arm)
+387
View File
@@ -0,0 +1,387 @@
# SeaweedFS
[![Build Status](https://travis-ci.org/chrislusf/seaweedfs.svg?branch=master)](https://travis-ci.org/chrislusf/seaweedfs)
[![GoDoc](https://godoc.org/github.com/chrislusf/seaweedfs/weed?status.svg)](https://godoc.org/github.com/chrislusf/seaweedfs/weed)
[![Wiki](https://img.shields.io/badge/docs-wiki-blue.svg)](https://github.com/chrislusf/seaweedfs/wiki)
![SeaweedFS Logo](https://raw.githubusercontent.com/chrislusf/seaweedfs/master/note/seaweedfs.png)
- [Download Binaries for different platforms](https://github.com/chrislusf/seaweedfs/releases/latest)
- [SeaweedFS Mailing List](https://groups.google.com/d/forum/seaweedfs)
- [Wiki Documentation](https://github.com/chrislusf/seaweedfs/wiki)
[![](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=EEECLJ8QGTTPC)
## Introduction
SeaweedFS is a simple and highly scalable distributed file system. There are two objectives:
1. to store billions of files!
2. to serve the files fast!
Instead of supporting full POSIX file system semantics, SeaweedFS choose to implement only a key->file mapping. Similar to "NoSQL", you might call it "NoFS".
Instead of managing all file metadata in a central master, the central master only manages file volumes, and it lets these volume servers manage files and their metadata. This relieves concurrency pressure from the central master and spreads file metadata into volume servers, allowing faster file access (just one disk read operation).
There is only a 40 bytes disk storage overhead for each file's metadata. It is so simple with O(1) disk read that you are welcome to challenge the performance with your actual use cases.
SeaweedFS started by implementing [Facebook's Haystack design paper](http://www.usenix.org/event/osdi10/tech/full_papers/Beaver.pdf). SeaweedFS is currently growing, with more features on the way.
## Additional Features
* Can choose no replication or different replication level, rack and data center aware
* Automatic master servers failover - no single point of failure (SPOF)
* Automatic Gzip compression depending on file mime type
* Automatic compaction to reclaimed disk spaces after deletion or update
* Servers in the same cluster can have different disk spaces, file systems, OS etc.
* Adding/Removing servers does **not** cause any data re-balancing
* Optional [filer server][Filer] provides "normal" directories and files via http
* Optionally fix the orientation for jpeg pictures
* Support Etag, Accept-Range, Last-Modified, etc.
* Support in-memory/leveldb/boltdb/btree mode tuning for memory/performance balance.
[Filer]: https://github.com/chrislusf/seaweedfs/wiki/Filer
## Example Usage
By default, the master node runs on port 9333, and the volume nodes runs on port 8080.
Here I will start one master node, and two volume nodes on port 8080 and 8081. Ideally, they should be started from different machines. I just use localhost as an example.
SeaweedFS uses HTTP REST operations to write, read, delete. The responses are in JSON or JSONP format.
### Start Master Server
```
> ./weed master
```
### Start Volume Servers ###
```
> weed volume -dir="/tmp/data1" -max=5 -mserver="localhost:9333" -port=8080 &
> weed volume -dir="/tmp/data2" -max=10 -mserver="localhost:9333" -port=8081 &
```
### Write File ###
To upload a file: first, send a HTTP POST, PUT, or GET request to `/dir/assign` to get an `fid` and a volume server url:
```
> curl -X POST http://localhost:9333/dir/assign
{"count":1,"fid":"3,01637037d6","url":"127.0.0.1:8080","publicUrl":"localhost:8080"}
```
Second, to store the file content, send a HTTP multi-part PUT or POST request to `url + '/' + fid` from the response:
```
> curl -X PUT -F file=@/home/chris/myphoto.jpg http://127.0.0.1:8080/3,01637037d6
{"size": 43234}
```
To update, send another PUT or POST request with updated file content.
For deletion, send an HTTP DELETE request to the same `url + '/' + fid` URL:
```
> curl -X DELETE http://127.0.0.1:8080/3,01637037d6
```
### Save File Id ###
Now you can save the `fid`, 3,01637037d6 in this case, to a database field.
The number 3 at the start represents a volume id. After the comma, it's one file key, 01, and a file cookie, 637037d6.
The volume id is an unsigned 32-bit integer. The file key is an unsigned 64-bit integer. The file cookie is an unsigned 32-bit integer, used to prevent URL guessing.
The file key and file cookie are both coded in hex. You can store the <volume id, file key, file cookie> tuple in your own format, or simply store the `fid` as string.
If stored as a string, in theory, you would need 8+1+16+8=33 bytes. A char(33) would be enough, if not more than enough, since most usage would not need 2^32 volumes.
If space is really a concern, you can store the file id in your own format. You would need one 4-byte integer for volume id, 8-byte long number for file key, 4-byte integer for file cookie. So 16 bytes are more than enough.
### Read File ###
Here is an example of how to render the URL.
First lookup the volume server's URLs by the file's volumeId:
```
> curl http://localhost:9333/dir/lookup?volumeId=3
{"locations":[{"publicUrl":"localhost:8080","url":"localhost:8080"}]}
```
Since (usually) there are not too many volume servers, and volumes don't move often, you can cache the results most of the time. Depends on the replication type, one volume can have multiple replica locations. Just randomly pick one location to read.)
Now you can take the public url, render the url or directly read from the volume server via url:
```
http://localhost:8080/3,01637037d6.jpg
```
Notice we add a file extension ".jpg" here. It's optional and just one way for the client to specify the file content type.
If you want a nicer URL, you can use one of these alternative URL formats:
```
http://localhost:8080/3/01637037d6/my_preferred_name.jpg
http://localhost:8080/3/01637037d6.jpg
http://localhost:8080/3,01637037d6.jpg
http://localhost:8080/3/01637037d6
http://localhost:8080/3,01637037d6
```
If you want get a scaled version of an image, you can add some params:
```
http://localhost:8080/3/01637037d6.jpg?height=200&width=200
http://localhost:8080/3/01637037d6.jpg?height=200&width=200&mode=fit
http://localhost:8080/3/01637037d6.jpg?height=200&width=200&mode=fill
```
### Rack-Aware and Data Center-Aware Replication ###
SeaweedFS applies the replication strategy at a volume level. So, when you are getting a file id, you can specify the replication strategy. For example:
```
curl -X POST http://localhost:9333/dir/assign?replication=001
```
The replication parameter options are:
```
000: no replication
001: replicate once on the same rack
010: replicate once on a different rack, but same data center
100: replicate once on a different data center
200: replicate twice on two different data center
110: replicate once on a different rack, and once on a different data center
```
More details about replication can be found [on the wiki][Replication].
[Replication]: https://github.com/chrislusf/seaweedfs/wiki/Replication
You can also set the default replication strategy when starting the master server.
### Allocate File Key on specific data center ###
Volume servers can start with a specific data center name:
```
weed volume -dir=/tmp/1 -port=8080 -dataCenter=dc1
weed volume -dir=/tmp/2 -port=8081 -dataCenter=dc2
```
When requesting a file key, an optional "dataCenter" parameter can limit the assigned volume to the specific data center. For example, this specifies that the assigned volume should be limited to 'dc1':
```
http://localhost:9333/dir/assign?dataCenter=dc1
```
### Other Features ###
* [No Single Point of Failure][feat-1]
* [Insert with your own keys][feat-2]
* [Chunking large files][feat-3]
* [Collection as a Simple Name Space][feat-4]
[feat-1]: https://github.com/chrislusf/seaweedfs/wiki/Failover-Master-Server
[feat-2]: https://github.com/chrislusf/seaweedfs/wiki/Optimization#insert-with-your-own-keys
[feat-3]: https://github.com/chrislusf/seaweedfs/wiki/Optimization#upload-large-files
[feat-4]: https://github.com/chrislusf/seaweedfs/wiki/Optimization#collection-as-a-simple-name-space
## Architecture ##
Usually distributed file systems split each file into chunks, a central master keeps a mapping of filenames, chunk indices to chunk handles, and also which chunks each chunk server has.
The main drawback is that the central master can't handle many small files efficiently, and since all read requests need to go through the chunk master, might not scale well for many concurrent users.
Instead of managing chunks, SeaweedFS manages data volumes in the master server. Each data volume is size 32GB, and can hold a lot of files. And each storage node can have many data volumes. So the master node only needs to store the metadata about the volumes, which is fairly small amount of data and is generally stable.
The actual file metadata is stored in each volume on volume servers. Since each volume server only manages metadata of files on its own disk, with only 16 bytes for each file, all file access can read file metadata just from memory and only needs one disk operation to actually read file data.
For comparison, consider that an xfs inode structure in Linux is 536 bytes.
### Master Server and Volume Server ###
The architecture is fairly simple. The actual data is stored in volumes on storage nodes. One volume server can have multiple volumes, and can both support read and write access with basic authentication.
All volumes are managed by a master server. The master server contains volume id to volume server mapping. This is fairly static information, and could be cached easily.
On each write request, the master server also generates a file key, which is a growing 64-bit unsigned integer. Since write requests are not generally as frequent as read requests, one master server should be able to handle the concurrency well.
### Write and Read files ###
When a client sends a write request, the master server returns (volume id, file key, file cookie, volume node url) for the file. The client then contacts the volume node and POSTs the file content.
When a client needs to read a file based on (volume id, file key, file cookie), it can ask the master server by the volume id for the (volume node url, volume node public url), or retrieve this from a cache. Then the client can GET the content, or just render the URL on web pages and let browsers fetch the content.
Please see the example for details on the write-read process.
### Storage Size ###
In the current implementation, each volume can be 8x2^32 bytes (32GiB). This is because of we align content to 8 bytes. We can easily increase this to 64G, or 128G, or more, by changing 2 lines of code, at the cost of some wasted padding space due to alignment.
There can be 2^32 volumes. So total system size is 8 x 2^32 bytes x 2^32 = 8 x 4GiB x 4Gi = 128EiB (2^67 bytes, or 128 exbibytes).
Each individual file size is limited to the volume size.
### Saving memory ###
All file meta information on volume server is readable from memory without disk access. Each file just takes an 16-byte map entry of <64bit key, 32bit offset, 32bit size>. Of course, each map entry has its own the space cost for the map. But usually the disk runs out before the memory does.
## Compared to Other File Systems ##
Most other distributed file systems seem more complicated than necessary.
### Compared to Ceph ###
Ceph can be setup similar to SeaweedFS as a key->blob store. It is much more complicated, with the need to support layers on top of it. [Here is a more detailed comparison](https://github.com/chrislusf/seaweedfs/issues/120)
SeaweedFS is meant to be fast and simple, both during usage and during setup. If you do not understand how it works when you reach here, we failed! Please raise an issue with any questions or update this file with clarifications.
SeaweedFS has a centralized master to lookup free volumes, while Ceph uses hashing to locate its objects. Having a centralized master makes it easy to code and manage. HDFS/GFS has the single name node for years. SeaweedFS now support multiple master nodes.
Ceph hashing avoids SPOF, but makes it complicated when moving or adding servers.
### Compared to HDFS ###
HDFS uses the chunk approach for each file, and is ideal for streaming large files.
SeaweedFS is ideal for serving relatively smaller files quickly and concurrently.
SeaweedFS can also store extra large files by splitting them into manageable data chunks, and store the file ids of the data chunks into a meta chunk. This is managed by "weed upload/download" tool, and the weed master or volume servers are agnostic about it.
### Compared to MogileFS ###
SeaweedFS has 2 components: directory server, storage nodes.
MogileFS has 3 components: tracers, database, storage nodes.
One more layer means slower access, more operation complexity, more failure possibility.
### Compared to GlusterFS ###
SeaweedFS is not POSIX compliant, and has a simple implementation.
GlusterFS is POSIX compliant, and is much more complex.
### Compared to MongoDB's GridFS ###
Mongo's GridFS splits files into chunks and manage chunks in the central MongoDB. For every read or write request, the database needs to query the metadata. It's OK if this is not yet a bottleneck, but for a lot of concurrent reads this unnecessary query could slow things down.
Since files are chunked(default to 256KB), there will be multiple metadata readings and multiple chunk readings, linear to the file size. One 2.56MB file would require at least 20 disk read requests.
On the contrary, SeaweedFS uses large file volume of 32G size to store lots of files, and only manages file volumes in the master server. Each volume manages file metadata itself. So all file metadata is spread across the volume nodes, and just one disk read is needed.
## Dev plan ##
More tools and documentation, on how to maintain and scale the system. For example, how to move volumes, automatically balancing data, how to grow volumes, how to check system status, etc.
This is a super exciting project! And I need helpers!
## Installation guide for users who are not familiar with golang
step 1: install go on your machine and setup the environment by following the instructions from the following link:
https://golang.org/doc/install
make sure you set up your $GOPATH
step 2: also you may need to install Mercurial by following the instructions below
http://mercurial.selenic.com/downloads
step 3: download, compile, and install the project by executing the following command
go get github.com/chrislusf/seaweedfs/weed
once this is done, you should see the executable "weed" under $GOPATH/bin
step 4: after you modify your code locally, you could start a local build by calling "go install" under $GOPATH/src/github.com/chrislusf/seaweedfs/weed
## Disk Related topics ##
### Hard Drive Performance ###
When testing read performance on SeaweedFS, it basically becomes performance test your hard drive's random read speed. Hard Drive usually get 100MB/s~200MB/s.
### Solid State Disk
To modify or delete small files, SSD must delete a whole block at a time, and move content in existing blocks to a new block. SSD is fast when brand new, but will get fragmented over time and you have to garbage collect, compacting blocks. SeaweedFS is friendly to SSD since it is append-only. Deletion and compaction are done on volume level in the background, not slowing reading and not causing fragmentation.
## Not Planned
POSIX support
## Benchmark
My Own Unscientific Single Machine Results on Mac Book with Solid State Disk, CPU: 1 Intel Core i7 2.6GHz.
Write 1 million 1KB file:
```
Concurrency Level: 16
Time taken for tests: 88.796 seconds
Complete requests: 1048576
Failed requests: 0
Total transferred: 1106764659 bytes
Requests per second: 11808.87 [#/sec]
Transfer rate: 12172.05 [Kbytes/sec]
Connection Times (ms)
min avg max std
Total: 0.2 1.3 44.8 0.9
Percentage of the requests served within a certain time (ms)
50% 1.1 ms
66% 1.3 ms
75% 1.5 ms
80% 1.7 ms
90% 2.1 ms
95% 2.6 ms
98% 3.7 ms
99% 4.6 ms
100% 44.8 ms
```
Randomly read 1 million files:
```
Concurrency Level: 16
Time taken for tests: 34.263 seconds
Complete requests: 1048576
Failed requests: 0
Total transferred: 1106762945 bytes
Requests per second: 30603.34 [#/sec]
Transfer rate: 31544.49 [Kbytes/sec]
Connection Times (ms)
min avg max std
Total: 0.0 0.5 20.7 0.7
Percentage of the requests served within a certain time (ms)
50% 0.4 ms
75% 0.5 ms
95% 0.6 ms
98% 0.8 ms
99% 1.2 ms
100% 20.7 ms
```
## License
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+17
View File
@@ -0,0 +1,17 @@
FROM frolvlad/alpine-glibc:alpine-3.5
RUN apk add --no-cache --virtual=build-dependencies --update curl wget ca-certificates && \
wget -P /tmp https://github.com/$(curl -s -L https://github.com/chrislusf/seaweedfs/releases/latest | egrep -o '/chrislusf/seaweedfs/releases/download/.*/linux_amd64.tar.gz') && \
tar -C /usr/bin/ -xzvf /tmp/linux_amd64.tar.gz && \
apk del curl wget ca-certificates build-dependencies && \
rm -rf /tmp/*
EXPOSE 8080
EXPOSE 9333
VOLUME /data
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
+23
View File
@@ -0,0 +1,23 @@
version: '2'
services:
master:
image: chrislusf/seaweedfs
ports:
- 9333:9333
command: "master"
networks:
default:
aliases:
- seaweed_master
volume:
image: chrislusf/seaweedfs
ports:
- 8080:8080
command: 'volume -max=5 -mserver="master:9333" -port=8080'
depends_on:
- master
networks:
default:
aliases:
- seaweed_volume
+34
View File
@@ -0,0 +1,34 @@
#!/bin/sh
case "$1" in
'master')
ARGS="-ip `hostname -i` -mdir /data"
# Is this instance linked with an other master? (Docker commandline "--link master1:master")
if [ -n "$MASTER_PORT_9333_TCP_ADDR" ] ; then
ARGS="$ARGS -peers=$MASTER_PORT_9333_TCP_ADDR:$MASTER_PORT_9333_TCP_PORT"
fi
exec /usr/bin/weed $@ $ARGS
;;
'volume')
ARGS="-ip `hostname -i` -dir /data"
# Is this instance linked with a master? (Docker commandline "--link master1:master")
if [ -n "$MASTER_PORT_9333_TCP_ADDR" ] ; then
ARGS="$ARGS -mserver=$MASTER_PORT_9333_TCP_ADDR:$MASTER_PORT_9333_TCP_PORT"
fi
exec /usr/bin/weed $@ $ARGS
;;
'server')
ARGS="-ip `hostname -i` -dir /data"
if [ -n "$MASTER_PORT_9333_TCP_ADDR" ] ; then
ARGS="$ARGS -master.peers=$MASTER_PORT_9333_TCP_ADDR:$MASTER_PORT_9333_TCP_PORT"
fi
exec /usr/bin/weed $@ $ARGS
;;
*)
exec /usr/bin/weed $@
;;
esac
+278
View File
@@ -0,0 +1,278 @@
64 32G volumes consumes 10G memory
Each volume has 25M index, so each cost 160MB memory
Things happened when I use lots of threads ( almost 120 ) keeping read file from SeaweedFS.
But I'm not so familiar with linux so I can't tell you exactly what happened.
Next I'll show you things I know , if you need more info , contact me
My SeaweedFS version is about 0.12
1. top
top - 12:07:37 up 1 day, 3:17, 2 users, load average: 0.00, 0.00, 0.00
Tasks: 152 total, 1 running, 151 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.0%us, 0.0%sy, 0.0%ni, 99.8%id, 0.1%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 16269880k total, 16192364k used, 77516k free, 58172k buffers
Swap: 2064376k total, 12324k used, 2052052k free, 2827520k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1499 root 20 0 11.6g 10g 1424 S 0.0 65.6 7:32.53 weedvolume
1498 root 20 0 3204m 2.1g 1428 S 0.0 13.5 4:36.59 weedvolume
1737 root 20 0 98868 4932 2920 S 0.0 0.0 0:00.56 sshd
1497 root 20 0 151m 4404 1152 S 0.0 0.0 1:21.40 weedmaster
1335 root 20 0 97816 3044 2896 S 0.0 0.0 0:00.76 sshd
After system became steady , weedvolume used 65.6% memory .
2. free -m
total used free shared buffers cached
Mem: 15888 15809 79 0 56 2758
-/+ buffers/cache: 12994 2894
Swap: 2015 12 2003
3. startup cmd
screen -d -m /opt/weed/weedmaster -mdir /data/weeddata/ > /data/logs/weed/master.log &
screen -d -m /opt/weed/weedvolume -volumes=0-64 -dir /data/weeddata/ -pulseSeconds=20 -publicUrl="x.y.z:9334" -port 9334 > /data/logs/weed/s01.log &
screen -d -m /opt/weed/weedvolume -volumes=65-107 -dir /data/weeddata/ -pulseSeconds=20 -publicUrl="x.y.z:9335" -port 9335 > /data/logs/weed/s02.log &
4. du -sh .
32G 0.dat
26M 0.idx
8.2G 100.dat
6.8M 100.idx
8.2G 101.dat
6.9M 101.idx
8.2G 102.dat
6.8M 102.idx
8.2G 103.dat
6.8M 103.idx
8.2G 104.dat
6.8M 104.idx
8.2G 105.dat
6.9M 105.idx
8.2G 106.dat
6.9M 106.idx
8.2G 107.dat
6.9M 107.idx
32G 10.dat
25M 10.idx
32G 11.dat
25M 11.idx
32G 12.dat
25M 12.idx
32G 13.dat
25M 13.idx
32G 14.dat
25M 14.idx
32G 15.dat
25M 15.idx
32G 16.dat
25M 16.idx
32G 17.dat
25M 17.idx
32G 18.dat
25M 18.idx
32G 19.dat
25M 19.idx
32G 1.dat
26M 1.idx
32G 20.dat
25M 20.idx
32G 21.dat
25M 21.idx
32G 22.dat
25M 22.idx
32G 23.dat
25M 23.idx
32G 24.dat
25M 24.idx
32G 25.dat
25M 25.idx
32G 26.dat
25M 26.idx
32G 27.dat
25M 27.idx
32G 28.dat
25M 28.idx
32G 29.dat
25M 29.idx
32G 2.dat
26M 2.idx
32G 30.dat
25M 30.idx
32G 31.dat
25M 31.idx
32G 32.dat
25M 32.idx
32G 33.dat
25M 33.idx
32G 34.dat
25M 34.idx
32G 35.dat
25M 35.idx
32G 36.dat
25M 36.idx
32G 37.dat
25M 37.idx
32G 38.dat
25M 38.idx
32G 39.dat
25M 39.idx
32G 3.dat
26M 3.idx
32G 40.dat
25M 40.idx
32G 41.dat
25M 41.idx
32G 42.dat
25M 42.idx
32G 43.dat
25M 43.idx
32G 44.dat
25M 44.idx
32G 45.dat
25M 45.idx
32G 46.dat
25M 46.idx
32G 47.dat
25M 47.idx
32G 48.dat
25M 48.idx
32G 49.dat
25M 49.idx
32G 4.dat
26M 4.idx
32G 50.dat
25M 50.idx
32G 51.dat
25M 51.idx
32G 52.dat
25M 52.idx
32G 53.dat
25M 53.idx
32G 54.dat
25M 54.idx
32G 55.dat
25M 55.idx
32G 56.dat
25M 56.idx
32G 57.dat
25M 57.idx
32G 58.dat
25M 58.idx
32G 59.dat
25M 59.idx
32G 5.dat
26M 5.idx
32G 60.dat
25M 60.idx
32G 61.dat
25M 61.idx
32G 62.dat
25M 62.idx
32G 63.dat
25M 63.idx
32G 64.dat
25M 64.idx
8.2G 65.dat
6.9M 65.idx
8.2G 66.dat
6.9M 66.idx
8.2G 67.dat
6.9M 67.idx
8.2G 68.dat
6.8M 68.idx
8.2G 69.dat
6.9M 69.idx
32G 6.dat
25M 6.idx
8.2G 70.dat
6.8M 70.idx
8.2G 71.dat
6.9M 71.idx
8.2G 72.dat
6.9M 72.idx
8.2G 73.dat
6.9M 73.idx
8.2G 74.dat
6.9M 74.idx
8.2G 75.dat
6.9M 75.idx
8.1G 76.dat
6.8M 76.idx
8.2G 77.dat
6.8M 77.idx
8.2G 78.dat
6.8M 78.idx
8.1G 79.dat
6.8M 79.idx
32G 7.dat
25M 7.idx
8.2G 80.dat
6.8M 80.idx
8.2G 81.dat
6.9M 81.idx
8.2G 82.dat
6.9M 82.idx
8.2G 83.dat
6.9M 83.idx
8.2G 84.dat
6.9M 84.idx
8.2G 85.dat
6.8M 85.idx
8.2G 86.dat
6.9M 86.idx
8.2G 87.dat
6.9M 87.idx
8.2G 88.dat
6.9M 88.idx
8.2G 89.dat
6.8M 89.idx
32G 8.dat
25M 8.idx
8.2G 90.dat
6.9M 90.idx
8.1G 91.dat
6.8M 91.idx
8.1G 92.dat
6.8M 92.idx
8.1G 93.dat
6.8M 93.idx
8.2G 94.dat
6.9M 94.idx
8.2G 95.dat
6.9M 95.idx
8.2G 96.dat
6.9M 96.idx
8.2G 97.dat
6.9M 97.idx
8.2G 98.dat
6.9M 98.idx
8.2G 99.dat
6.9M 99.idx
32G 9.dat
25M 9.idx
4.0K directory.seq
You can see the volume 1-64 is now full.
5. more log
see logs.zip
In messages you can see these lines: (Line 51095)
Sep 26 06:14:31 wedb-01 kernel: auditd: page allocation failure. order:0, mode:0x20
Sep 26 06:14:31 wedb-01 kernel: Pid: 1009, comm: auditd Not tainted 2.6.32-220.el6.x86_64 #1
Sep 26 06:14:31 wedb-01 kernel: Call Trace:
After those lines , the system deny any new network connect request
6. /dir/status
{"Machines":[{"Server":{"Url":"127.0.0.1:9335","PublicUrl":"x.y.z:9335"},"Volumes":[{"Id":106,"Size":8728909632},{"Id":66,"Size":8729852744},{"Id":90,"Size":8747834896},{"Id":103,"Size":8718106024},{"Id":87,"Size":8732133512},{"Id":96,"Size":8737251904},{"Id":80,"Size":8704130712},{"Id":77,"Size":8717989496},{"Id":70,"Size":8731474744},{"Id":94,"Size":8758656144},{"Id":107,"Size":8729599232},{"Id":67,"Size":8736848088},{"Id":91,"Size":8665847760},{"Id":100,"Size":8703272552},{"Id":84,"Size":8745121528},{"Id":97,"Size":8713031744},{"Id":81,"Size":8726088872},{"Id":74,"Size":8738588152},{"Id":71,"Size":8729349920},{"Id":95,"Size":8741526896},{"Id":104,"Size":8699374736},{"Id":88,"Size":8740362880},{"Id":101,"Size":8711832992},{"Id":85,"Size":8723479552},{"Id":78,"Size":8700345400},{"Id":75,"Size":8727796912},{"Id":68,"Size":8698607440},{"Id":92,"Size":8682683056},{"Id":105,"Size":8741226152},{"Id":65,"Size":8725365752},{"Id":89,"Size":8703062600},{"Id":98,"Size":8742331560},{"Id":82,"Size":8762554952},{"Id":79,"Size":8696300376},{"Id":72,"Size":8708217304},{"Id":69,"Size":8740268144},{"Id":93,"Size":8685060320},{"Id":102,"Size":8708695352},{"Id":86,"Size":8783247776},{"Id":99,"Size":8753463608},{"Id":83,"Size":8725963952},{"Id":76,"Size":8694693536},{"Id":73,"Size":8733560832}]},{"Server":{"Url":"127.0.0.1:9334","PublicUrl":"x.y.z:9334"},"Volumes":[{"Id":34,"Size":33415706800},{"Id":58,"Size":33569224784},{"Id":18,"Size":33474649968},{"Id":55,"Size":33542422680},{"Id":15,"Size":33517247576},{"Id":48,"Size":33574860328},{"Id":8,"Size":33511257144},{"Id":45,"Size":33463948408},{"Id":5,"Size":34317702920},{"Id":29,"Size":33465695776},{"Id":38,"Size":33553119624},{"Id":62,"Size":33448316736},{"Id":22,"Size":33566586296},{"Id":35,"Size":33493733728},{"Id":59,"Size":33498554904},{"Id":19,"Size":33493313784},{"Id":52,"Size":33552978448},{"Id":12,"Size":33505183752},{"Id":49,"Size":33603029896},{"Id":9,"Size":33515778064},{"Id":42,"Size":33500402248},{"Id":2,"Size":34223232992},{"Id":26,"Size":33526519600},{"Id":39,"Size":33580414336},{"Id":63,"Size":33476332456},{"Id":23,"Size":33543872592},{"Id":32,"Size":33515290168},{"Id":56,"Size":33499171184},{"Id":16,"Size":33556591168},{"Id":64,"Size":33495148616},{"Id":53,"Size":33467738560},{"Id":13,"Size":33596873960},{"Id":46,"Size":33508120448},{"Id":6,"Size":33417470256},{"Id":30,"Size":33532933992},{"Id":43,"Size":33591802008},{"Id":3,"Size":34270682080},{"Id":27,"Size":33525736944},{"Id":36,"Size":33443597824},{"Id":60,"Size":33427931336},{"Id":20,"Size":33499083096},{"Id":33,"Size":33531396280},{"Id":57,"Size":33578015104},{"Id":17,"Size":33510525480},{"Id":50,"Size":33503123704},{"Id":10,"Size":33502391608},{"Id":47,"Size":33521868568},{"Id":7,"Size":33497101664},{"Id":31,"Size":33426905232},{"Id":40,"Size":33472978696},{"Id":0,"Size":34337344304},{"Id":24,"Size":33550157192},{"Id":37,"Size":33477162720},{"Id":61,"Size":33537175080},{"Id":21,"Size":33517192456},{"Id":54,"Size":33480720288},{"Id":14,"Size":33513192896},{"Id":51,"Size":33531336080},{"Id":11,"Size":33562385088},{"Id":44,"Size":33554479104},{"Id":4,"Size":34333127520},{"Id":28,"Size":33510503000},{"Id":41,"Size":33574922928},{"Id":1,"Size":34307181368},{"Id":25,"Size":33542834568}]}],"Writers":[106,66,90,103,87,96,80,77,70,94,107,67,91,100,84,97,81,74,71,95,104,88,101,85,78,75,68,92,105,65,89,98,82,79,72,69,93,102,86,99,83,76,73,34,58,18,55,15,48,8,45,5,29,38,62,22,35,59,19,52,12,49,9,42,2,26,39,63,23,32,56,16,64,53,13,46,6,30,43,3,27,36,60,20,33,57,17,50,10,47,7,31,40,0,24,37,61,21,54,14,51,11,44,4,28,41,1,25],"FileIdSequence":110250000}
+109
View File
@@ -0,0 +1,109 @@
1. each file can choose the replication factor
2. replication granularity is in volume level
3. if not enough spaces, we can automatically decrease some volume's the replication factor, especially for cold data
4. plan to support migrating data to cheaper storage
5. plan to manual volume placement, access-based volume placement, auction based volume placement
When a new volume server is started, it reports
1. how many volumes it can hold
2. current list of existing volumes and each volume's replication type
Each volume server remembers:
1. current volume ids
2. replica locations are read from the master
The master assign volume ids based on
1. replication factor
data center, rack
2. concurrent write support
On master, stores the replication configuration
{
replication:{
{type:"00", min_volume_count:3, weight:10},
{type:"01", min_volume_count:2, weight:20},
{type:"10", min_volume_count:2, weight:20},
{type:"11", min_volume_count:3, weight:30},
{type:"20", min_volume_count:2, weight:20}
},
port:9333,
}
Or manually via command line
1. add volume with specified replication factor
2. add volume with specified volume id
If duplicated volume ids are reported from different volume servers,
the master determines the replication factor of the volume,
if less than the replication factor, the volume is in readonly mode
if more than the replication factor, the volume will purge the smallest/oldest volume
if equal, the volume will function as usual
Use cases:
on volume server
1. weed volume -mserver="xx.xx.xx.xx:9333" -publicUrl="good.com:8080" -dir="/tmp" -volumes=50
on weed master
1. weed master -port=9333
generate a default json configuration file if doesn't exist
Bootstrap
1. at the very beginning, the system has no volumes at all.
When data node starts:
1. each data node send to master its existing volumes and max volume blocks
2. master remembers the topology/data_center/rack/data_node/volumes
for each replication level, stores
volume id ~ data node
writable volume ids
If any "assign" request comes in
1. find a writable volume with the right replicationLevel
2. if not found, grow the volumes with the right replication level
3. return a writable volume to the user
for data node:
0. detect existing volumes DONE
1. onStartUp, and periodically, send existing volumes and maxVolumeCount store.Join(), DONE
2. accept command to grow a volume( id + replication level) DONE
/admin/assign_volume?volume=some_id&replicationType=01
3. accept setting volumeLocationList DONE
/admin/set_volume_locations_list?volumeLocationsList=[{Vid:xxx,Locations:[loc1,loc2,loc3]}]
4. for each write, pass the write to the next location, (Step 2)
POST method should accept an index, like ttl, get decremented every hop
for master:
1. accept data node's report of existing volumes and maxVolumeCount ALREADY EXISTS /dir/join
2. periodically refresh for active data nodes, and adjust writable volumes
3. send command to grow a volume(id + replication level) DONE
5. accept lookup for volume locations ALREADY EXISTS /dir/lookup
6. read topology/datacenter/rack layout
An algorithm to allocate volumes evenly, but may be inefficient if free volumes are plenty:
input: replication=xyz
algorithm:
ret_dcs = []
foreach dc that has y+z+1 volumes{
ret_racks = []
foreach rack with z+1 volumes{
ret = select z+1 servers with 1 volume
if ret.size()==z+1 {
ret_racks.append(ret)
}
}
randomly pick one rack from ret_racks
ret += select y racks with 1 volume each
if ret.size()==y+z+1{
ret_dcs.append(ret)
}
}
randomly pick one dc from ret_dcs
ret += select x data centers with 1 volume each
A simple replica placement algorithm, but may fail when free volume slots are not plenty:
ret := []volumes
dc = randomly pick 1 data center with y+z+1 volumes
rack = randomly pick 1 rack with z+1 volumes
ret = ret.append(randomly pick z+1 volumes)
ret = ret.append(randomly pick y racks with 1 volume)
ret = ret.append(randomly pick x data centers with 1 volume)
TODO:
1. replicate content to the other server if the replication type needs replicas
Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

+51
View File
@@ -0,0 +1,51 @@
Design for SeaweedFS security
Design Objectives
Security can mean many different things. The original vision is that: if you have one machine lying around
somewhere with some disk space, it should be able to join your file system to contribute some disk space and
network bandwidth, securely!
To achieve this purpose, the security should be able to:
1. Secure the inter-server communication. Only real cluster servers can join and communicate.
2. allow clients to securely write to volume servers
Non Objective
Multi-tenant support. Avoid filers or clients cross-updating files.
User specific access control.
Design Architect
master, and volume servers all talk securely via 2-way SSL for admin operations.
upon joining, master gives its secret key to volume servers.
filer or clients talk to master to get secret key, and use the key to generate JWT to write on volume server.
A side benefit:
a time limited read feature?
4. volume server needs to expose https ports
HTTP Connections
clear http
filer~>master, need to get a JWT from master
filer~>volume
2-way https
master~ssl~>volume
volume~ssl~>master
file uploading:
when volume server starts, it asks master for the secret key to decode JWT
when filer/clients wants to upload, master generate a JWT
filer~>volume(public port)
master~>volume(public port)
Currently, volume server has 2 ip addresses: ip and publicUrl.
The ip is for admin purpose, and master talk to volume server this way.
The publicUrl is for clients to access the server, via http GET/POST/DELETE etc.
The write operations are secured by JWT.
clients talk to master also via https? possible. Decide on this later.
Dev plan:
1. volume server separate admin from public GET/POST/DELETE handlers
The step 1 may be good enough for most use cases.
If 2-way ssl are still needed
2. volume server add ssl support
3. https connections to operate on volume servers
+46
View File
@@ -0,0 +1,46 @@
How to submit a content
1. Find physical volumes
1.c Create a hash value
1.d find a write logic volume id, and return [logic volume id, {physical volume ids}]
2. submit to physical volumes
2.c
generate the cookie
generate a unique id as key
choose the right altKey
send bytes to physical volumes
2.s each
save bytes
store map[key uint64, altKey uint32]<offset, size>
for updated entry, set old entry's offset to zero
3.c
wait for all physical volumes to finish
store the /<logic volume id>/<key>_<cookie>_<altKey>.<ext>
How to retrieve a content
1.c
send logic volume id
1.d
find least busy volume's id
2.c
send URI /<physical volume id>/<key>_<cookie>_<altKey>.<ext>
How to submit a content
1. send bytes to SeaweedFS, got <volume id, key uint64, cookie code>
store <key uint64, volume id uint32, cookie code uint32, ext>, and other information
To read a content
2. use logic volume id to lookup a <machine id>
render url as /<machine id>/<volume id>/<key>/<cookie>.ext
The directory server
0.init
load and collect <logic volume id, machine ids> mapping
1.on submit content
find a free logic volume id, start sending content to 3 machines
if all of them finishes, return <logic volume id, key, cookie code>
2.on read content
based on logic volume id, pick a machine with less load,
return <machine id>
-2
View File
@@ -1,2 +0,0 @@
*.sh text eol=lf
core/chunkkernel/chunk-kernel-2.tsv text eol=lf
-47
View File
@@ -1,47 +0,0 @@
# Model citations for mapped files
The spec-trace workflow reads `model-code-trace.tsv` and the validator from
the target branch. A PR cannot replace its own mapping or checker.
Each non-comment line has two tab-separated columns: an exact repository
path and `Module.Action`. Repeat a path to list alternative actions that
cover it. Paths are case-sensitive; directories and glob patterns are not
expanded. Missing, empty or malformed mappings refuse the check.
The reviewed map uses the neutral public module names: `SnapshotRemoval`,
`RestoreTarget`, `HolderInterface`, `EngineAdapter`, `StopAndRestart`,
`MoveAdmission`, `Promotion`, `ProbeRound`, `FencingRound`, `VolumeCreate`,
`ReplicationPeer` and `RestoreCommand`.
Actions name top-level definitions used by the corresponding model's `Next`.
The mapping is the source of accepted citations; private model names and
storage locations do not belong in the public map or PR description.
For every changed mapped path, including deletions, the PR's `Model:` line
must contain a listed action or `NONE (pure function of Module)` for that
module. Separate multiple citations with semicolons, for example:
```text
Model: EngineAdapter.Begin; MoveAdmission.Revoke; NONE (pure function of RestoreTarget)
```
Unmapped paths keep the existing spec-trace policy. The pure-function
declaration is a review claim; CI checks its module, not its truth.
## Adding a model or file
1. Have the model owner confirm its neutral public module name and the
top-level action definitions used by `Next`. Use those names in public
code, mapping rows and PR descriptions.
2. Add an exact-path TSV row for each implementation and enforcement file
that the action covers. Split actions get separate rows. Include receiving
guards as well as senders; a reviewer checks that each file really enforces
the cited action. Environment actions without a Go site and mutant test
obligations are not implementation mappings.
3. Add controls for accepted and refused citations when extending the
checker. For mapping additions, check the real map against representative
affected paths. Run `python3 -B .github/scripts/model-trace-check-test.py`
and `bash .github/scripts/spec-trace-check-test.sh` on Linux.
4. Submit the map and its evidence for review with the model change or before
its callers land. The PR description cites the applicable public actions.
The new rows govern later PRs once they are on the target branch; changing
a PR's own map never changes the check that evaluates that PR.
-208
View File
@@ -1,208 +0,0 @@
# Exact repository-relative path<TAB>Module.Action; repeat a path for alternatives.
cmd/sw-block/volume_backup.go RestoreCommand.Abort
cmd/sw-block/volume_backup.go RestoreCommand.AbortVerify
cmd/sw-block/volume_backup.go RestoreCommand.Run
cmd/sw-block/volume_backup.go RestoreCommand.Start
core/authority/workspace.go HolderInterface.ForcedMove
core/authority/workspace.go HolderInterface.PlannedMove
core/authority/workspace.go MoveAdmission.Ack
core/authority/workspace.go MoveAdmission.IssueClean
core/authority/workspace.go MoveAdmission.IssueForced
core/authority/workspace.go MoveAdmission.Lease2Ends
core/authority/workspace.go MoveAdmission.LeaseEnds
core/authority/workspace.go MoveAdmission.ReadForMove
core/authority/workspace.go MoveAdmission.Revoke
core/authority/workspace.go StopAndRestart.IssueClean
core/authority/workspace.go StopAndRestart.IssueForced
core/authority/workspace.go StopAndRestart.LeaseEnds
core/authority/workspace.go StopAndRestart.ReadForced
core/authority/workspace_delete_reservation.go MoveAdmission.DelCheck
core/authority/workspace_delete_reservation.go MoveAdmission.Reserve
core/authority/workspace_lease_view.go HolderInterface.Grant
core/authority/workspace_lease_view.go HolderInterface.Regrant
core/engine/apply.go ReplicationPeer.Reconcile
core/frontend/chunkstore/layout/claim.go EngineAdapter.Takeover
core/frontend/chunkstore/layout/claim.go MoveAdmission.ClaimB
core/frontend/chunkstore/layout/claim.go SnapshotRemoval.Claim
core/frontend/chunkstore/layout/claim.go StopAndRestart.ClaimB
core/frontend/chunkstore/layout/clean.go EngineAdapter.MaintBegin
core/frontend/chunkstore/layout/clean.go EngineAdapter.MaintEnd
core/frontend/chunkstore/layout/clean.go SnapshotRemoval.BeginClean
core/frontend/chunkstore/layout/clean.go SnapshotRemoval.EndClean
core/frontend/chunkstore/layout/commit.go EngineAdapter.Apply
core/frontend/chunkstore/layout/commit.go SnapshotRemoval.Commit
core/frontend/chunkstore/layout/commit.go VolumeCreate.Commit
core/frontend/chunkstore/layout/create.go RestoreTarget.CreateHead
core/frontend/chunkstore/layout/create.go RestoreTarget.CreateVol
core/frontend/chunkstore/layout/create.go VolumeCreate.Claim
core/frontend/chunkstore/layout/delete.go MoveAdmission.DelMark
core/frontend/chunkstore/layout/delete.go MoveAdmission.DelRead
core/frontend/chunkstore/layout/delete.go RestoreTarget.OpRelease
core/frontend/chunkstore/layout/delete.go RestoreTarget.OpTomb
core/frontend/chunkstore/layout/head.go SnapshotRemoval.Abort
core/frontend/chunkstore/layout/head.go SnapshotRemoval.Begin
core/frontend/chunkstore/layout/head.go StopAndRestart.Apply
core/frontend/chunkstore/layout/head.go StopAndRestart.Begin
core/frontend/chunkstore/layout/objects.go SnapshotRemoval.Upload
core/frontend/chunkstore/layout/remove.go SnapshotRemoval.Issue
core/frontend/chunkstore/layout/remove.go SnapshotRemoval.Stat
core/frontend/chunkstore/layout/remove.go SnapshotRemoval.Validate
core/frontend/chunkstore/layout/snapshots.go EngineAdapter.OpWrite
core/frontend/chunkstore/layout/snapshots.go MoveAdmission.OpWrite
core/frontend/chunkstore/layout/snapshots.go RestoreTarget.AddDep
core/frontend/chunkstore/layout/snapshots.go SnapshotRemoval.DeleteSnap
core/frontend/chunkstore/layout/start.go HolderInterface.Start
core/frontend/chunkstore/layout/start.go StopAndRestart.CrashRestart
core/frontend/chunkstore/layout/start.go VolumeCreate.Claim
core/frontend/chunkstore/layout_create.go VolumeCreate.IssueHead
core/frontend/chunkstore/layout_create.go VolumeCreate.IssueVol
core/frontend/chunkstore/layout_remote.go EngineAdapter.Begin
core/frontend/chunkstore/layout_remote.go EngineAdapter.ReadHead
core/frontend/chunkstore/layout_remote.go EngineAdapter.SendCommit
core/frontend/chunkstore/layout_remote.go EngineAdapter.SettleAbort
core/frontend/chunkstore/layout_remote.go EngineAdapter.TakeAbandon
core/frontend/chunkstore/layout_remote.go StopAndRestart.SendCommit
core/frontend/chunkstore/layout_remote.go StopAndRestart.SettleAbort
core/frontend/chunkstore/layout_store.go SnapshotRemoval.ApplyDelete
core/frontend/chunkstore/layout_store.go SnapshotRemoval.ApplyMark
core/frontend/chunkstore/swfs.go VolumeCreate.Land
core/frontend/durable/provider_chunk.go EngineAdapter.SettleResume
core/frontend/durable/provider_chunk.go EngineAdapter.StartStop
core/frontend/durable/provider_chunk.go HolderInterface.StopBegin
core/frontend/durable/provider_chunk.go StopAndRestart.SendDetach
core/frontend/durable/provider_chunk.go StopAndRestart.SettleResume
core/frontend/durable/provider_layout.go EngineAdapter.SettleDown
core/frontend/durable/provider_layout.go StopAndRestart.SettleDown
core/frontend/durable/storage_adapter.go EngineAdapter.GuestWrite
core/frontend/durable/storage_adapter.go HolderInterface.Write
core/host/master/layout_ready.go VolumeCreate.Place
core/host/master/probe_round.go FencingRound.Deliver
core/host/master/probe_round.go FencingRound.Open
core/host/master/product_loop.go FencingRound.Decide
core/host/master/product_loop.go Promotion.Decide
core/host/master/store_attestation.go ReplicationPeer.Attest
core/host/master/workspace_service.go MoveAdmission.ReadForMove
core/host/master/workspace_service.go StopAndRestart.ReadClean
core/host/volume/primary_evidence.go FencingRound.Adopt
core/host/volume/primary_evidence.go Promotion.Adopt
core/host/volume/primary_evidence.go Promotion.Refuse
core/host/volume/probe_round.go FencingRound.Answer
core/host/volume/workspace_lease.go HolderInterface.Expire
core/host/volume/workspace_lease.go MoveAdmission.StopOnExpiry
core/host/volume/workspace_lease.go MoveAdmission.Write
core/host/volume/workspace_lease.go SnapshotRemoval.Expire
core/host/volume/workspace_lease.go StopAndRestart.Write
core/lifecycle/store.go VolumeCreate.MarkReady
core/lifecycle/store.go VolumeCreate.Record
core/replication/peer.go Promotion.Ship1
core/replication/peer.go Promotion.Ship2
core/replication/peer.go ReplicationPeer.Barrier
core/replication/peer.go ReplicationPeer.Fail
core/replication/peer.go ReplicationPeer.Heal
core/replication/peer.go ReplicationPeer.Ship
core/replication/volume.go FencingRound.Ack
core/replication/volume.go Promotion.Ack1
core/replication/volume.go Promotion.Rejoin
core/replication/volume.go Promotion.Write1
core/replication/volume.go Promotion.Write2
core/replication/volume.go ReplicationPeer.Ack
core/replication/volume.go ReplicationPeer.Write
core/storage/chunk_head_belt.go HolderInterface.Fence
core/storage/chunk_layer.go EngineAdapter.EngineReRead
core/storage/chunk_layer.go EngineAdapter.NoOpCut
core/storage/chunk_layer.go HolderInterface.Commit
core/storage/chunk_layer.go HolderInterface.StopCommit
core/storage/chunk_layer.go MoveAdmission.Detach
core/storage/chunk_layer.go MoveAdmission.Publish
core/storage/chunk_layer.go SnapshotRemoval.Write
core/storage/chunk_state_upgrade.go SlotFence.Publish
core/storage/chunk_state_upgrade.go SlotFence.Sync
core/transport/catchup_sender.go ReplicationPeer.CatchUp
core/transport/rebuild_sender.go ReplicationPeer.Rebuild
core/transport/replica.go FencingRound.Recv
core/transport/replica.go ReplicationPeer.CatchUp
core/transport/replica.go ReplicationPeer.Rebuild
core/transport/replica.go ReplicationPeer.Ship
core/storage/chunk_coverage.go SlotFence.Publish
core/storage/chunk_coverage_map.go MoveWide2.Write
core/storage/walstore_v3.go SlotFence2.OpenNew
core/frontend/chunkstore/snapshot_operation.go SnapOps.Send
core/frontend/chunkstore/snapshot_operation.go SnapOps.TornAdmit
core/frontend/chunkstore/snapshot_operation.go SnapOps.Retire
core/frontend/chunkstore/snapshot_operation_index.go SnapOps.TermFlag
core/frontend/chunkstore/snapshot_operation_index.go SnapOps.GC
core/frontend/chunkstore/snapshot_operation_index.go SnapOps.Poll
core/frontend/chunkstore/snapshot_operation_guard.go SnapOps.Publish
core/frontend/chunkstore/snapshot_operation_guard.go SnapOps.Delete
core/host/volume/chunk_control.go SnapOps.Start
cmd/sw-block/snapshot_operation.go SnapOps.Send
core/host/volume/snapshot_operation.go SnapOps.Start
cmd/blockvolume/snapshot_operation_shutdown.go SnapOps.Stall
core/frontend/chunkstore/snapshot_delete_operation.go SnapDelete.Send
core/storage/wal_admission_fast.go WALHold.FastArrive
core/storage/wal_admission_fast.go WALHold.FastReEnter
core/storage/wal_admission_fast.go WALHold.FastResubmit
core/storage/wal_admission.go WALHold.Arrive
core/storage/wal_admission_fifo.go WALHold.Arrive
core/storage/wal_admission_fifo.go WALHold.ReEnter
core/storage/wal_admission_fifo.go WALHold.Admit
core/storage/walstore.go WALHold.Admit
core/frontend/durable/storage_adapter.go WALHold.Resubmit
core/storage/flusher.go WALHold.Reclaim
core/storage/wal_hold_window.go WALHold.Stall
core/storage/wal_write_hold.go WALHold.Stall
core/storage/wal_hold_window.go WALHold.CapAnswer
core/storage/wal_write_hold.go WALHold.CapAnswer
core/frontend/nvme/io.go WALHold.Stall
core/frontend/iscsi/scsi.go WALHold.Stall
core/host/master/format_gate.go FormatGate.Finalize
core/host/master/format_gate.go FormatGate.Place
core/host/master/workspace_service.go FormatGate.Place
core/host/master/format_gate.go FormatGate.Grant
core/host/master/workspace_binding.go FormatGate.Grant
core/host/master/format_gate.go FormatGate.Report
core/host/master/services.go FormatGate.Report
core/host/master/format_gate.go FormatGate.Retire
core/host/volume/host.go FormatGate.Upgrade
core/host/volume/host.go FormatGate.Downgrade
core/frontend/chunkstore/layout/format_level.go FormatGate.Upgrade1
core/frontend/chunkstore/layout/format_level.go FormatGate.PublishOp
core/frontend/chunkstore/snapshot_delete_target.go FormatGate.AdmitOp
core/frontend/chunkstore/snapshot_delete_operation.go FormatGate.AdmitOp
core/storage/recovery_progress.go RecoveryProgress.Replay
core/host/volume/recovery_watchdog.go RecoveryProgress.Replay
core/storage/walstore_v3.go RecoveryProgress.Fence
core/host/volume/recovery_watchdog.go RecoveryProgress.Fence
core/host/volume/recovery_watchdog.go RecoveryProgress.ToFence
core/host/volume/recovery_watchdog.go RecoveryProgress.Authority
core/host/volume/recovery_watchdog.go RecoveryProgress.Stall
core/frontend/chunkstore/layout/delete_intent.go PageChain.WritePage
core/frontend/chunkstore/layout/list_chain.go PageChain.WritePage
core/frontend/chunkstore/layout/delete_intent.go PageChain.Send
core/frontend/chunkstore/layout/list_chain.go PageChain.Send
core/frontend/chunkstore/layout/delete_intent.go PageChain.Resend
core/frontend/chunkstore/layout/list_chain.go PageChain.Resend
core/frontend/chunkstore/layout/delete_intent.go PageChain.CRead
core/frontend/chunkstore/layout/list_chain.go PageChain.CRead
core/frontend/chunkstore/layout/delete_intent.go PageChain.CApply
core/frontend/chunkstore/layout/delete_intent.go PageChain.CAdvance
core/frontend/chunkstore/layout/list_chain.go PageChain.CAdvance
core/frontend/chunkstore/layout/delete_intent.go PageChain.CResolve
core/frontend/chunkstore/layout/list_chain.go PageChain.CResolve
core/frontend/chunkstore/clean_intent_b.go PageChain.CRead
core/frontend/chunkstore/layout_remote.go PageChain.CRead
core/frontend/chunkstore/layout/remove.go PageChain.Sweep
core/frontend/chunkstore/clean_b.go PageChain.Sweep
core/frontend/chunkstore/layout/remove.go StaleClean.Stat
core/frontend/chunkstore/layout/remove.go StaleClean.HeadRead
core/frontend/chunkstore/layout/remove.go StaleClean.MarkIt
core/frontend/chunkstore/layout/remove.go StaleClean.DeleteIt
core/frontend/chunkstore/layout_store.go StaleClean.Adopt
core/frontend/chunkstore/layout/commit.go StaleClean.HeadCommit
core/frontend/chunkstore/layout/commit.go StaleClean.CommitCheck
core/frontend/chunkstore/layout/delete_intent.go QueueCap.Produce
core/frontend/chunkstore/layout/list_chain.go QueueCap.Produce
core/frontend/chunkstore/layout/delete_intent.go QueueCap.Consume
core/frontend/chunkstore/clean_intent_b.go QueueCap.Consume
core/frontend/chunkstore/layout/commit.go QueueCap.TakeBack
1 # Exact repository-relative path<TAB>Module.Action; repeat a path for alternatives.
2 cmd/sw-block/volume_backup.go RestoreCommand.Abort
3 cmd/sw-block/volume_backup.go RestoreCommand.AbortVerify
4 cmd/sw-block/volume_backup.go RestoreCommand.Run
5 cmd/sw-block/volume_backup.go RestoreCommand.Start
6 core/authority/workspace.go HolderInterface.ForcedMove
7 core/authority/workspace.go HolderInterface.PlannedMove
8 core/authority/workspace.go MoveAdmission.Ack
9 core/authority/workspace.go MoveAdmission.IssueClean
10 core/authority/workspace.go MoveAdmission.IssueForced
11 core/authority/workspace.go MoveAdmission.Lease2Ends
12 core/authority/workspace.go MoveAdmission.LeaseEnds
13 core/authority/workspace.go MoveAdmission.ReadForMove
14 core/authority/workspace.go MoveAdmission.Revoke
15 core/authority/workspace.go StopAndRestart.IssueClean
16 core/authority/workspace.go StopAndRestart.IssueForced
17 core/authority/workspace.go StopAndRestart.LeaseEnds
18 core/authority/workspace.go StopAndRestart.ReadForced
19 core/authority/workspace_delete_reservation.go MoveAdmission.DelCheck
20 core/authority/workspace_delete_reservation.go MoveAdmission.Reserve
21 core/authority/workspace_lease_view.go HolderInterface.Grant
22 core/authority/workspace_lease_view.go HolderInterface.Regrant
23 core/engine/apply.go ReplicationPeer.Reconcile
24 core/frontend/chunkstore/layout/claim.go EngineAdapter.Takeover
25 core/frontend/chunkstore/layout/claim.go MoveAdmission.ClaimB
26 core/frontend/chunkstore/layout/claim.go SnapshotRemoval.Claim
27 core/frontend/chunkstore/layout/claim.go StopAndRestart.ClaimB
28 core/frontend/chunkstore/layout/clean.go EngineAdapter.MaintBegin
29 core/frontend/chunkstore/layout/clean.go EngineAdapter.MaintEnd
30 core/frontend/chunkstore/layout/clean.go SnapshotRemoval.BeginClean
31 core/frontend/chunkstore/layout/clean.go SnapshotRemoval.EndClean
32 core/frontend/chunkstore/layout/commit.go EngineAdapter.Apply
33 core/frontend/chunkstore/layout/commit.go SnapshotRemoval.Commit
34 core/frontend/chunkstore/layout/commit.go VolumeCreate.Commit
35 core/frontend/chunkstore/layout/create.go RestoreTarget.CreateHead
36 core/frontend/chunkstore/layout/create.go RestoreTarget.CreateVol
37 core/frontend/chunkstore/layout/create.go VolumeCreate.Claim
38 core/frontend/chunkstore/layout/delete.go MoveAdmission.DelMark
39 core/frontend/chunkstore/layout/delete.go MoveAdmission.DelRead
40 core/frontend/chunkstore/layout/delete.go RestoreTarget.OpRelease
41 core/frontend/chunkstore/layout/delete.go RestoreTarget.OpTomb
42 core/frontend/chunkstore/layout/head.go SnapshotRemoval.Abort
43 core/frontend/chunkstore/layout/head.go SnapshotRemoval.Begin
44 core/frontend/chunkstore/layout/head.go StopAndRestart.Apply
45 core/frontend/chunkstore/layout/head.go StopAndRestart.Begin
46 core/frontend/chunkstore/layout/objects.go SnapshotRemoval.Upload
47 core/frontend/chunkstore/layout/remove.go SnapshotRemoval.Issue
48 core/frontend/chunkstore/layout/remove.go SnapshotRemoval.Stat
49 core/frontend/chunkstore/layout/remove.go SnapshotRemoval.Validate
50 core/frontend/chunkstore/layout/snapshots.go EngineAdapter.OpWrite
51 core/frontend/chunkstore/layout/snapshots.go MoveAdmission.OpWrite
52 core/frontend/chunkstore/layout/snapshots.go RestoreTarget.AddDep
53 core/frontend/chunkstore/layout/snapshots.go SnapshotRemoval.DeleteSnap
54 core/frontend/chunkstore/layout/start.go HolderInterface.Start
55 core/frontend/chunkstore/layout/start.go StopAndRestart.CrashRestart
56 core/frontend/chunkstore/layout/start.go VolumeCreate.Claim
57 core/frontend/chunkstore/layout_create.go VolumeCreate.IssueHead
58 core/frontend/chunkstore/layout_create.go VolumeCreate.IssueVol
59 core/frontend/chunkstore/layout_remote.go EngineAdapter.Begin
60 core/frontend/chunkstore/layout_remote.go EngineAdapter.ReadHead
61 core/frontend/chunkstore/layout_remote.go EngineAdapter.SendCommit
62 core/frontend/chunkstore/layout_remote.go EngineAdapter.SettleAbort
63 core/frontend/chunkstore/layout_remote.go EngineAdapter.TakeAbandon
64 core/frontend/chunkstore/layout_remote.go StopAndRestart.SendCommit
65 core/frontend/chunkstore/layout_remote.go StopAndRestart.SettleAbort
66 core/frontend/chunkstore/layout_store.go SnapshotRemoval.ApplyDelete
67 core/frontend/chunkstore/layout_store.go SnapshotRemoval.ApplyMark
68 core/frontend/chunkstore/swfs.go VolumeCreate.Land
69 core/frontend/durable/provider_chunk.go EngineAdapter.SettleResume
70 core/frontend/durable/provider_chunk.go EngineAdapter.StartStop
71 core/frontend/durable/provider_chunk.go HolderInterface.StopBegin
72 core/frontend/durable/provider_chunk.go StopAndRestart.SendDetach
73 core/frontend/durable/provider_chunk.go StopAndRestart.SettleResume
74 core/frontend/durable/provider_layout.go EngineAdapter.SettleDown
75 core/frontend/durable/provider_layout.go StopAndRestart.SettleDown
76 core/frontend/durable/storage_adapter.go EngineAdapter.GuestWrite
77 core/frontend/durable/storage_adapter.go HolderInterface.Write
78 core/host/master/layout_ready.go VolumeCreate.Place
79 core/host/master/probe_round.go FencingRound.Deliver
80 core/host/master/probe_round.go FencingRound.Open
81 core/host/master/product_loop.go FencingRound.Decide
82 core/host/master/product_loop.go Promotion.Decide
83 core/host/master/store_attestation.go ReplicationPeer.Attest
84 core/host/master/workspace_service.go MoveAdmission.ReadForMove
85 core/host/master/workspace_service.go StopAndRestart.ReadClean
86 core/host/volume/primary_evidence.go FencingRound.Adopt
87 core/host/volume/primary_evidence.go Promotion.Adopt
88 core/host/volume/primary_evidence.go Promotion.Refuse
89 core/host/volume/probe_round.go FencingRound.Answer
90 core/host/volume/workspace_lease.go HolderInterface.Expire
91 core/host/volume/workspace_lease.go MoveAdmission.StopOnExpiry
92 core/host/volume/workspace_lease.go MoveAdmission.Write
93 core/host/volume/workspace_lease.go SnapshotRemoval.Expire
94 core/host/volume/workspace_lease.go StopAndRestart.Write
95 core/lifecycle/store.go VolumeCreate.MarkReady
96 core/lifecycle/store.go VolumeCreate.Record
97 core/replication/peer.go Promotion.Ship1
98 core/replication/peer.go Promotion.Ship2
99 core/replication/peer.go ReplicationPeer.Barrier
100 core/replication/peer.go ReplicationPeer.Fail
101 core/replication/peer.go ReplicationPeer.Heal
102 core/replication/peer.go ReplicationPeer.Ship
103 core/replication/volume.go FencingRound.Ack
104 core/replication/volume.go Promotion.Ack1
105 core/replication/volume.go Promotion.Rejoin
106 core/replication/volume.go Promotion.Write1
107 core/replication/volume.go Promotion.Write2
108 core/replication/volume.go ReplicationPeer.Ack
109 core/replication/volume.go ReplicationPeer.Write
110 core/storage/chunk_head_belt.go HolderInterface.Fence
111 core/storage/chunk_layer.go EngineAdapter.EngineReRead
112 core/storage/chunk_layer.go EngineAdapter.NoOpCut
113 core/storage/chunk_layer.go HolderInterface.Commit
114 core/storage/chunk_layer.go HolderInterface.StopCommit
115 core/storage/chunk_layer.go MoveAdmission.Detach
116 core/storage/chunk_layer.go MoveAdmission.Publish
117 core/storage/chunk_layer.go SnapshotRemoval.Write
118 core/storage/chunk_state_upgrade.go SlotFence.Publish
119 core/storage/chunk_state_upgrade.go SlotFence.Sync
120 core/transport/catchup_sender.go ReplicationPeer.CatchUp
121 core/transport/rebuild_sender.go ReplicationPeer.Rebuild
122 core/transport/replica.go FencingRound.Recv
123 core/transport/replica.go ReplicationPeer.CatchUp
124 core/transport/replica.go ReplicationPeer.Rebuild
125 core/transport/replica.go ReplicationPeer.Ship
126 core/storage/chunk_coverage.go SlotFence.Publish
127 core/storage/chunk_coverage_map.go MoveWide2.Write
128 core/storage/walstore_v3.go SlotFence2.OpenNew
129 core/frontend/chunkstore/snapshot_operation.go SnapOps.Send
130 core/frontend/chunkstore/snapshot_operation.go SnapOps.TornAdmit
131 core/frontend/chunkstore/snapshot_operation.go SnapOps.Retire
132 core/frontend/chunkstore/snapshot_operation_index.go SnapOps.TermFlag
133 core/frontend/chunkstore/snapshot_operation_index.go SnapOps.GC
134 core/frontend/chunkstore/snapshot_operation_index.go SnapOps.Poll
135 core/frontend/chunkstore/snapshot_operation_guard.go SnapOps.Publish
136 core/frontend/chunkstore/snapshot_operation_guard.go SnapOps.Delete
137 core/host/volume/chunk_control.go SnapOps.Start
138 cmd/sw-block/snapshot_operation.go SnapOps.Send
139 core/host/volume/snapshot_operation.go SnapOps.Start
140 cmd/blockvolume/snapshot_operation_shutdown.go SnapOps.Stall
141 core/frontend/chunkstore/snapshot_delete_operation.go SnapDelete.Send
142 core/storage/wal_admission_fast.go WALHold.FastArrive
143 core/storage/wal_admission_fast.go WALHold.FastReEnter
144 core/storage/wal_admission_fast.go WALHold.FastResubmit
145 core/storage/wal_admission.go WALHold.Arrive
146 core/storage/wal_admission_fifo.go WALHold.Arrive
147 core/storage/wal_admission_fifo.go WALHold.ReEnter
148 core/storage/wal_admission_fifo.go WALHold.Admit
149 core/storage/walstore.go WALHold.Admit
150 core/frontend/durable/storage_adapter.go WALHold.Resubmit
151 core/storage/flusher.go WALHold.Reclaim
152 core/storage/wal_hold_window.go WALHold.Stall
153 core/storage/wal_write_hold.go WALHold.Stall
154 core/storage/wal_hold_window.go WALHold.CapAnswer
155 core/storage/wal_write_hold.go WALHold.CapAnswer
156 core/frontend/nvme/io.go WALHold.Stall
157 core/frontend/iscsi/scsi.go WALHold.Stall
158 core/host/master/format_gate.go FormatGate.Finalize
159 core/host/master/format_gate.go FormatGate.Place
160 core/host/master/workspace_service.go FormatGate.Place
161 core/host/master/format_gate.go FormatGate.Grant
162 core/host/master/workspace_binding.go FormatGate.Grant
163 core/host/master/format_gate.go FormatGate.Report
164 core/host/master/services.go FormatGate.Report
165 core/host/master/format_gate.go FormatGate.Retire
166 core/host/volume/host.go FormatGate.Upgrade
167 core/host/volume/host.go FormatGate.Downgrade
168 core/frontend/chunkstore/layout/format_level.go FormatGate.Upgrade1
169 core/frontend/chunkstore/layout/format_level.go FormatGate.PublishOp
170 core/frontend/chunkstore/snapshot_delete_target.go FormatGate.AdmitOp
171 core/frontend/chunkstore/snapshot_delete_operation.go FormatGate.AdmitOp
172 core/storage/recovery_progress.go RecoveryProgress.Replay
173 core/host/volume/recovery_watchdog.go RecoveryProgress.Replay
174 core/storage/walstore_v3.go RecoveryProgress.Fence
175 core/host/volume/recovery_watchdog.go RecoveryProgress.Fence
176 core/host/volume/recovery_watchdog.go RecoveryProgress.ToFence
177 core/host/volume/recovery_watchdog.go RecoveryProgress.Authority
178 core/host/volume/recovery_watchdog.go RecoveryProgress.Stall
179 core/frontend/chunkstore/layout/delete_intent.go PageChain.WritePage
180 core/frontend/chunkstore/layout/list_chain.go PageChain.WritePage
181 core/frontend/chunkstore/layout/delete_intent.go PageChain.Send
182 core/frontend/chunkstore/layout/list_chain.go PageChain.Send
183 core/frontend/chunkstore/layout/delete_intent.go PageChain.Resend
184 core/frontend/chunkstore/layout/list_chain.go PageChain.Resend
185 core/frontend/chunkstore/layout/delete_intent.go PageChain.CRead
186 core/frontend/chunkstore/layout/list_chain.go PageChain.CRead
187 core/frontend/chunkstore/layout/delete_intent.go PageChain.CApply
188 core/frontend/chunkstore/layout/delete_intent.go PageChain.CAdvance
189 core/frontend/chunkstore/layout/list_chain.go PageChain.CAdvance
190 core/frontend/chunkstore/layout/delete_intent.go PageChain.CResolve
191 core/frontend/chunkstore/layout/list_chain.go PageChain.CResolve
192 core/frontend/chunkstore/clean_intent_b.go PageChain.CRead
193 core/frontend/chunkstore/layout_remote.go PageChain.CRead
194 core/frontend/chunkstore/layout/remove.go PageChain.Sweep
195 core/frontend/chunkstore/clean_b.go PageChain.Sweep
196 core/frontend/chunkstore/layout/remove.go StaleClean.Stat
197 core/frontend/chunkstore/layout/remove.go StaleClean.HeadRead
198 core/frontend/chunkstore/layout/remove.go StaleClean.MarkIt
199 core/frontend/chunkstore/layout/remove.go StaleClean.DeleteIt
200 core/frontend/chunkstore/layout_store.go StaleClean.Adopt
201 core/frontend/chunkstore/layout/commit.go StaleClean.HeadCommit
202 core/frontend/chunkstore/layout/commit.go StaleClean.CommitCheck
203 core/frontend/chunkstore/layout/delete_intent.go QueueCap.Produce
204 core/frontend/chunkstore/layout/list_chain.go QueueCap.Produce
205 core/frontend/chunkstore/layout/delete_intent.go QueueCap.Consume
206 core/frontend/chunkstore/clean_intent_b.go QueueCap.Consume
207 core/frontend/chunkstore/layout/commit.go QueueCap.TakeBack
-94
View File
@@ -1,94 +0,0 @@
# What a PR labelled "post-merge-review" may touch.
#
# A labelled PR passes the "post-merge-review paths" check only if EVERY
# changed file (both names of a rename) matches an allow line and no "!"
# line. Anything not allowed is denied: new files start denied. A PR that
# fails keeps the full review before merge. Without the label the check
# passes and nothing changes.
#
# One bash glob per line, matched against the repo-relative path; "*" also
# matches "/". A line starting with "!" denies, and wins over any allow line.
# Blank lines and text after "#" are ignored. The check reads this file from
# the base branch, so a PR cannot loosen its own check; a missing or empty
# file fails the check.
# ---- Allowed ----
# Docs.
docs/*
*.md
# Tests: added or modified, never deleted or moved (the check enforces
# that); a test file in a denied directory stays denied.
*_test.go
# Status, metrics and observation files, by name.
core/host/master/observation_service.go
core/host/master/observation_snapshot.go
core/host/volume/memory_status.go
core/ops/observation.go
core/ops/observation_bundle.go
core/ops/observation_dashboard.go
core/ops/observation_report.go
core/ops/volume_status_artifacts.go
core/ops/volume_status_report.go
core/ops/volume_status_report_collector.go
core/ops/volume_status_summary.go
# ---- Denied even if allowed above ----
# The check itself and CI.
!.github/*
# The test gates: the testops engine, its CLI and the gate definitions
# (their docs stay allowed).
!internal/testops/*.go
!internal/testops/*.json
!cmd/sw-testops/*
# Data path and replication.
!core/storage/*
!core/frontend/*
!core/transport/*
!core/replication/*
!core/recovery/*
!core/engine/*
!core/adapter/*
# Authority: lease, epoch, fencing, move.
!core/authority/*
!core/host/master/workspace_*
!core/host/volume/workspace_*
!cmd/blockvolume/workspace_lease*
# Wire and persisted formats.
!*.proto
!*.pb.go
!core/host/master/journal_isolation*
!core/lifecycle/store*
!cmd/sparrow/persist*
# GC and delete paths.
!cmd/sw-block/chunk_gc*
!cmd/sw-block/chunk_volume_delete*
!core/lifecycle/deletion_reservations*
!core/ops/delete_safety_contract*
!*/gc[_.]*
!*_gc[_.]*
# Lease, epoch, claim, admission, GC, delete or format code (tests included)
# wherever it lives, by file name.
!*/lease*.go
!*_lease*.go
!*epoch*.go
!*fenc*.go
!*claim*.go
!*admission*.go
!*/gc_*.go
!*_gc.go
!*_gc_*.go
!*delet*.go
!*purge*.go
!*persist*.go
!*journal*.go
!*format*.go
-47
View File
@@ -1,47 +0,0 @@
# Seconds each process-level test took on the CI runner (main 032eb197, run 45972669823),
# used only to balance the parallel shards (.github/scripts/shard-named-tests.py). A test
# missing here counts as 60 s; a stale time unbalances the shards but never skips a test.
TestAVolumeThatServedBeforeItsFirstGateTickFailsOver 31.4
TestClaimedTargetAfterAMasterRestartIsNotNeverStarted 18.7
TestCutoverCreateFromSnapshot 25.4
TestCutoverWriteSnapshotKillRestartRestore 34.1
TestDoubleFailoverReadsBackEveryAckedWrite 10.2
TestFencingRoundHealContinuesThePrimary 13.4
TestFencingRoundSurvivorRejoins 17.0
TestKnownZeroAcceptance 27.1
TestKnownZeroTargetReservesBeforeHarness 0.0
TestNeverAttachedRestoreTargetIsDeletable 16.5
TestNeverStartedDeleteAfterAMasterRestart 166.8
TestNeverStartedDeleteFencesALateStart 53.6
TestNeverStartedDeleteRacesAStart 42.4
TestNeverStartedLineDeleteFencesALateStart 240.3
TestNeverStartedLineDeleteRacesAStart 458.9
TestNeverStartedLineIsDeletableWithoutARevoke 335.1
TestProcedureDeleteAVolume 79.1
TestProcedureDeleteAfterASignalStop 116.1
TestProcedureForcedMoveWithTheOldHostReturning 100.2
TestProcedureMasterKilledAfterMoveBeforeTargetStarts 23.2
TestProcedureMasterUnreachableFencesBeforeForcedMove 159.4
TestProcedurePlannedHandoffToAnotherHost 16.8
TestProcedureReturnAfterALapsedLease 81.4
TestProcedureRevokeWithoutACKThenForcedMove 79.6
TestProcedureSameHostCrashRestartInsideTheLease 17.5
TestProcedureSameHostRestartInsideTheLease 17.5
TestProcedureStartInsideTheBarrierWaitIsReGranted 80.0
TestSnapshotLadderA1OneBlockOneSnapshot 18.8
TestSnapshotLadderA2IncrementalSnapshot 20.9
TestSnapshotLadderA3WritesDuringASnapshot 26.1
TestSnapshotLadderA4ContentReturnsToAnOldValue 23.6
TestSnapshotLadderB1SnapshotQuery 19.1
TestSnapshotLadderC1FullRestore 18.8
TestSnapshotLadderC2IncrementalRestore 21.3
TestSnapshotLadderC3KilledHydrating 35.6
TestSnapshotLadderC3RestoreThenWriteThenSnapshotIt 21.3
TestSnapshotLadderD1DeleteTheNewest 21.4
TestSnapshotLadderD2DeleteAMiddleOne 23.9
TestSnapshotLadderD3DeleteWhenContentRecurs 21.3
TestSnapshotLadderD4DeleteAllButOneThenCollect 19.4
TestSnapshotLadderE1CrashDuringASnapshot 31.1
TestSnapshotLadderF1VolumesOneHost 528.4
TestStandaloneCleanMoveWithoutTheACKIsRefused 16.6
TestStandalonePlannedHandoffToTheSameHost 17.7
-91
View File
@@ -1,91 +0,0 @@
# Process-level tests (cmd/blockvolume with build tags subprocess and
# chunkstore_integration, linux) named as release evidence. CI runs them
# against real blockmaster, blockvolume and sw-block binaries and the pinned
# SeaweedFS release. Every name here must PASS: a skip, a failure or a test
# that never ran fails the job (.github/scripts/required-tests-check.py).
#
# Not here, and why: the three headroom tests (TestHeadroom*), the power-loss
# replay (TestPowerLossReplayChunkVolume, a dm-log-writes harness) and the
# tests tagged systemd_integration need root, a loop or mapped device, or
# systemd; the CI runners have none of these. They run as root outside CI,
# and their counts are recorded there.
# Known-zero acceptance, small shape in CI (KZ_RUN=1 KZ_SIZE=1G, user-space
# client, no device); the 1 TiB run is lab only.
TestKnownZeroAcceptance
TestKnownZeroTargetReservesBeforeHarness
# The procedure gate, delete and master loss.
TestProcedurePlannedHandoffToAnotherHost
TestProcedureSameHostRestartInsideTheLease
TestProcedureSameHostCrashRestartInsideTheLease
TestProcedureReturnAfterALapsedLease
TestProcedureForcedMoveWithTheOldHostReturning
TestProcedureRevokeWithoutACKThenForcedMove
TestProcedureStartInsideTheBarrierWaitIsReGranted
TestProcedureDeleteAVolume
TestANewClustersRealHolderReportsLevel1AndIsGranted
TestProcedureDeleteAfterASignalStop
TestProcedureMasterKilledAfterMoveBeforeTargetStarts
TestProcedureMasterUnreachableFencesBeforeForcedMove
TestStandalonePlannedHandoffToTheSameHost
TestStandaloneCleanMoveWithoutTheACKIsRefused
# Failover and the fencing round.
TestDoubleFailoverReadsBackEveryAckedWrite
# The replicated preview's fencing round runs and is reported on every job but
# does not gate it (#920: a sync-quorum flush under shared-runner load); it
# gates the nightly run on a quiet lab box.
TestFencingRoundHealContinuesThePrimary # nongating=#920
TestFencingRoundSurvivorRejoins # nongating=#920
TestAVolumeThatServedBeforeItsFirstGateTickFailsOver
# Many volumes on one host (F1_RUN=1).
TestSnapshotLadderF1VolumesOneHost
# Never-started delete.
TestNeverAttachedRestoreTargetIsDeletable
TestNeverStartedDeleteFencesALateStart
TestNeverStartedDeleteRacesAStart
TestNeverStartedLineIsDeletableWithoutARevoke
TestNeverStartedLineDeleteFencesALateStart
TestNeverStartedLineDeleteRacesAStart
TestNeverStartedDeleteAfterAMasterRestart
TestClaimedTargetAfterAMasterRestartIsNotNeverStarted
# Snapshot ladders and cutover.
TestSnapshotLadderA1OneBlockOneSnapshot
TestSnapshotLadderA2IncrementalSnapshot
TestSnapshotLadderA3WritesDuringASnapshot
TestSnapshotLadderA4ContentReturnsToAnOldValue
TestSnapshotLadderB1SnapshotQuery
TestSnapshotLadderC1FullRestore
TestSnapshotLadderC2IncrementalRestore
TestSnapshotLadderC3RestoreThenWriteThenSnapshotIt
# A first write after the holder reports its frontend ready can be answered
# namespace-not-ready for longer than a host retries (#905, a v1.1 release
# gate); it runs and is reported on every job until the fix removes this.
TestSnapshotLadderC3KilledHydrating # nongating=#905
TestSnapshotLadderD1DeleteTheNewest
TestSnapshotLadderD2DeleteAMiddleOne
TestSnapshotLadderD3DeleteWhenContentRecurs
TestSnapshotLadderD4DeleteAllButOneThenCollect
TestSnapshotLadderE1CrashDuringASnapshot
TestCutoverCreateFromSnapshot
TestCutoverWriteSnapshotKillRestartRestore
# CSI real-binary seams: dispatched to blockcsi.test in the same process job.
# package=blockcsi is routing metadata; the required-test checker needs all names.
TestBlockCSI_BinaryStartsAndServesIdentity # package=blockcsi
TestG15a_BlockCSIControllerPublishUsesMasterFrontendFact # package=blockcsi
TestG15c_BlockCSICreateVolumeWritesMasterLifecycleIntent # package=blockcsi
# Typed delete stdout remains separate from HEAD diagnostics.
TestDeleteNoRevokeKeepsTheTypedStdoutSeparate
# Procedure ordering compares the UTC log instant including its fraction.
TestProcedureLogTimesUseTheUTCInstant
# Snapshot operation intent and publication receipts survive real holder kills.
TestSnapshotOperationIntentAndPublicationCrashBoundaries
TestSnapshotOperationKillReceiptRejectsOrdinaryExit
-43
View File
@@ -1,43 +0,0 @@
Feature: <roadmap item>
Machine/INV: <kind> / <INV rows>
Model: <Module.Action; OtherModule.Action, or NONE (pure function of Module) for mapped files>
Red-first: <commit + test that failed on the base, or NONE: reason>
Simplest: <the simplest version, and what this PR did not add>
Five questions, answered in plain words before review:
Serves: <which statement of the specification or the docs this change serves>
Decided by: <whose decision this is, and where it is recorded>
Layer use: <conventional: the layer below is used the usual way; or the deviation>
Deviation buys: <what the deviation buys, measured; or none: no deviation>
Weakens: <which existing guarantee this weakens (its cost, the way it fails, a mode it leaves out, whether its proof runs on the production type), or none and why>
Facts: <per fact this change adds or changes, its one placement class: DURABLE; MEMORY-REBUILT-FAST (its rebuild cost, bounded by the change since the last durable point, or constant); or MEMORY-MAY-BE-LOST (its loss only delays or repeats bounded idempotent work, and resets to refuse). Also where it lives and what a restart and an abort do. Or none -- and why>
<!--
The spec-trace check reads the lines above.
Machine/INV starts with exactly one kind:
IMPL <machine>.<transition> implements an existing transition; no new state, flag or reason.
FIX <INV-ID> the red test is that invariant failing on the base.
CHANGE <machine> new or changed states, transitions or invariants; the automaton
text and rows land with or before the code.
A fix without an invariant, or a guard term without a transition, is a CHANGE.
A PR that changes no behaviour uses one of these instead, checked against its files:
DOCS docs (not docs/spec), tests, and Go whose tokens are unchanged
(comments only; directive comments count as code).
TEST only tests, testdata and test helpers.
CI only .github/ (scripts/ ships install and deploy scripts).
DOCS may still change contract text (docs/design/invariants.md): the reviewer is the gate for that.
NONE needs a reason of at least 10 characters. Simplest is required when the PR
changes non-test Go under core/ or cmd/.
Weakens and Facts are required on every PR that changes product code: a review
is refused without them. "none" needs its reason.
A fact that fits none of the three placement classes is a finding: the review
is refused.
Mapped files in .github/model-code-trace.tsv require a listed Module.Action
or NONE (pure function of Module). Separate citations for multiple modules
with semicolons. Unmapped files retain the existing Model trace policy.
-->
-53
View File
@@ -1,53 +0,0 @@
#!/usr/bin/env bash
# Self-test of changed-go-blobs.sh and of the fetch setting the PR checks use:
# a PR tree that names a '..' entry must neither write outside the output
# directory nor be fetched at all.
set -euo pipefail
script=$(cd "$(dirname "$0")" && pwd)/changed-go-blobs.sh
t=$(mktemp -d)
trap 'rm -rf "$t"' EXIT
fail() { echo "changed-go-blobs-test: FAIL: $*" >&2; exit 1; }
git init -q "$t/r"
cd "$t/r"
git config user.email t@example.com
git config user.name t
mkdir -p a
printf 'package a\n' >a/a.go
printf 'package a\n' >a/a_test.go
git add . && git commit -q -m base
base=$(git rev-parse HEAD)
# 1. An ordinary change: the old and new blobs land under the output directory.
printf 'package a\n\nvar X = 1\n' >a/a.go
printf 'package b\n' >b.go
git add . && git commit -q -m change
bash "$script" "$base" HEAD "$t/out1"
grep -q 'var X' "$t/out1/new/a/a.go" || fail "new blob of a/a.go missing"
[ -f "$t/out1/old/a/a.go" ] || fail "old blob of a/a.go missing"
[ -f "$t/out1/new/b.go" ] && [ ! -e "$t/out1/old/b.go" ] || fail "added file b.go not new-only"
[ ! -e "$t/out1/new/a/a_test.go" ] || fail "a test file was written"
# 2. A crafted tree: '..' nested three times, holding x.go. git writes such
# a tree only with --literally; the diff still lists '../../../x.go', and
# writing blobs by that path would create new/../../../x.go, outside the
# output directory (the inline loop this script replaced did exactly that).
blob=$(printf 'package evil\n' | git hash-object -w --stdin)
entry() { perl -e 'print $ARGV[0], "\0", pack("H*", $ARGV[1])' "$1" "$2"; }
tr=$(entry "100644 x.go" "$blob" | git hash-object -t tree --literally -w --stdin)
for _ in 1 2 3; do tr=$(entry "40000 .." "$tr" | git hash-object -t tree --literally -w --stdin); done
evil=$(git commit-tree "$tr" -p "$base" -m evil)
mkdir -p "$t/deep/ws/out2"
if bash "$script" "$base" "$evil" "$t/deep/ws/out2" 2>"$t/err"; then fail "a '..' path was accepted"; fi
grep -q 'refusing path' "$t/err" || fail "refusal not reported: $(cat "$t/err")"
[ -z "$(find "$t/deep" -name x.go)" ] || fail "a file was written outside the output directory"
# 3. The checks fetch the PR head with fetch.fsckObjects=true: the crafted
# tree is refused at the fetch.
git update-ref refs/pull/1/head "$evil"
git init -q "$t/c"
cd "$t/c"
if git -c fetch.fsckObjects=true fetch -q --no-tags "$t/r" "+refs/pull/1/head:refs/remotes/pr/head" 2>"$t/err2"; then
fail "fetch with fsckObjects accepted a '..' tree"
fi
echo "changed-go-blobs-test: PASS (3 cases)"
-29
View File
@@ -1,29 +0,0 @@
#!/usr/bin/env bash
# Writes the old and new blob of each changed non-test Go file between two
# commits under <out>/old/<path> and <out>/new/<path>, for the spec trace's
# kind DOCS (objects only; nothing from the PR is built or run).
#
# usage: changed-go-blobs.sh <merge-base> <head> <out>
#
# The paths come from the PR's tree objects, which git does not check when it
# prints a diff. A path that is absolute or has an empty, '.' or '..'
# component would write outside <out>, so it is refused before anything is
# written (exit 1).
set -euo pipefail
mb=$1 head=$2 out=$3
mkdir -p "$out"
git diff --name-only --no-renames -z "$mb" "$head" -- "*.go" ":(exclude)*_test.go" >"$out/.paths"
while IFS= read -r -d "" p; do
case "/$p/" in
*//* | */./* | */../*)
printf 'changed-go-blobs: refusing path %q\n' "$p" >&2
exit 1
;;
esac
done <"$out/.paths"
while IFS= read -r -d "" p; do
mkdir -p "$out/old/$(dirname "$p")" "$out/new/$(dirname "$p")"
git show "$mb:$p" >"$out/old/$p" 2>/dev/null || rm -f "$out/old/$p"
git show "$head:$p" >"$out/new/$p" 2>/dev/null || rm -f "$out/new/$p"
done <"$out/.paths"
rm -f "$out/.paths"
-53
View File
@@ -1,53 +0,0 @@
#!/usr/bin/env bash
# Tests chunkstore-scope.sh against real commits. Any failure exits nonzero.
set -euo pipefail
here=$(cd "$(dirname "$0")" && pwd)
scope="$here/chunkstore-scope.sh"
fail=0
check() { # name want got
if [ "$2" = "$3" ]; then echo "ok $1"; else echo "FAIL $1: want [$2], got [$3]"; fail=1; fi
}
repo=$(mktemp -d)
trap 'rm -rf "$repo"' EXIT
cd "$repo"
git init -q
git config user.email t@example.invalid
git config user.name t
git config core.autocrlf false
mkdir -p core/frontend/chunkstore core/frontend/durable core/storage core/other docs
echo c >core/frontend/chunkstore/c.go
echo p >core/frontend/durable/p.go
echo s >core/storage/s.go
echo o >core/other/o.go
echo d >docs/d.md
git add -A
git commit -qm base
base=$(git rev-parse HEAD)
case_of() { # name want: commit the current tree, classify against base, reset
git add -A
git commit -qm "$1" --allow-empty
check "$1" "$2" "$(bash "$scope" "$base" HEAD)"
git reset -q --hard "$base"
}
echo c2 >core/frontend/chunkstore/c.go
case_of "a chunkstore file" "run 1 core/frontend/chunkstore/c.go"
echo p2 >core/frontend/durable/p.go
case_of "a durable provider file only" "run 1 core/frontend/durable/p.go"
echo s2 >core/storage/s.go; echo o2 >core/other/o.go
case_of "storage and another package" "run 2 core/storage/s.go"
echo o2 >core/other/o.go; echo d2 >docs/d.md
case_of "neither path" "skip 2"
case_of "no file changed" "skip 0"
mkdir -p core/storage-old; echo x >core/storage-old/x.go
case_of "a storage-like prefix" "skip 1"
git rm -q core/storage/s.go
case_of "a storage deletion" "run 1 core/storage/s.go"
for i in $(seq 1 20000); do printf 'x\n' >"docs/f$i.md"; done
echo late >core/storage/zz_late.go
case_of "20000 other files and one storage file, listed last" "run 20001 core/storage/zz_late.go"
if out=$(bash "$scope" "$base" no-such-revision 2>/dev/null); then
check "an unknown revision is an error" "nonzero exit" "exit 0: $out"
else
check "an unknown revision is an error" "nonzero exit" "nonzero exit"
fi
exit "$fail"
-33
View File
@@ -1,33 +0,0 @@
#!/usr/bin/env bash
# chunkstore-scope.sh BASE HEAD: decides whether a pull request runs the
# real-filer integration tests. It prints one line:
# "run N FIRST" at least one of the N changed files is under
# core/frontend/chunkstore/, core/storage/ or
# core/frontend/durable/ (FIRST is one)
# "skip N" none of the N changed files is
# and exits 0. Any error (git fails, the list cannot be read) exits nonzero,
# and the caller then runs the tests: an error never selects skip.
#
# The NUL-delimited list is written to a file first and read to its end, so
# no pipe can stop early and leave a writer's error looking like an answer.
set -euo pipefail
[ "$#" -eq 2 ] || { echo "usage: chunkstore-scope.sh BASE HEAD" >&2; exit 2; }
list=$(mktemp)
trap 'rm -f "$list"' EXIT
if ! git diff --name-only --no-renames -z "$1" "$2" >"$list"; then
echo "chunkstore-scope: git diff $1 $2 failed" >&2
exit 2
fi
n=0
hit=""
while IFS= read -r -d '' f; do
n=$((n + 1))
case $f in
core/frontend/chunkstore/* | core/storage/* | core/frontend/durable/*) [ -n "$hit" ] || hit=$f ;;
esac
done <"$list"
if [ -n "$hit" ]; then
echo "run $n $hit"
else
echo "skip $n"
fi
-41
View File
@@ -1,41 +0,0 @@
# Failed-job evidence
Both test suites keep one `ci-<suite>-<run>-<attempt>` artifact on failure for
14 days. `go-test.json` contains Go's timestamped events and per-test `Elapsed`
values; process shards also keep their original JSON, logs and exit receipts.
`go-test.stderr` keeps build/tool errors outside Go's JSON event stream. The
console still shows the original test output. Recording/rendering errors are
best effort: they report the missing evidence and keep draining Go, whose own
exit code alone decides the wrapper's result. Test arguments, scope, timeouts,
exit-code handling and the required-tests gate are unchanged.
`load.tsv` begins immediately after checkout and samples once per second until
the final collection step. It covers setup, builds and tests; the checkout
itself and the artifact upload are outside the sampling interval. The sampler
has the job's maximum lifetime if cancellation prevents its stop step. The
stop receipt includes the process start time, so a recycled PID is not killed.
Columns:
- `ts_utc`: UTC timestamp with milliseconds. Scheduling gaps remain visible;
delayed sampling does not invent backfilled one-second rows.
- `load1`: machine load average.
- `steal_pct`, `iowait_pct`: interval percentages from `/proc/stat` (the first
row has no baseline and is null). Guest counters are not counted twice.
- `psi_cpu`, `psi_io`, `psi_mem`: JSON objects containing the kernel's `some`
and, when available, `full` pressure averages and cumulative microseconds.
- `disk_await_ms`: JSON map by device, calculated as the interval's read/write
milliseconds divided by completed reads/writes from `/proc/diskstats`.
Devices are kept separate, including partitions and device-mapper layers;
do not sum them. No completed IO, reset counters or a new device yields null.
Discard and flush-only operations are not included in this read/write mean.
- `cgroup_cpu_max`: JSON map of `cpu.max` for the sampler's current cgroup and
every visible ancestor. The sampler inherits the job's cgroup. Parent quotas
matter even when the leaf says `max`. Cgroup v1/unavailable data is null.
- `errors`: read/parse errors; missing or inaccessible counters are null,
never fabricated zero load. Consult `load.sampler.log` for sampler errors.
No package installation, sudo, or `iostat` executable is required. `/proc`
CPU/PSI/disk observations are machine-wide; these are correlation evidence,
not proof that the job itself caused contention. Sampling is diagnostic and
does not revoke, retry or change a test's result.
-129
View File
@@ -1,129 +0,0 @@
"""Fixed Linux counter fixtures; no host load or privileged runner needed."""
import importlib.util
import json
import pathlib
import subprocess
import sys
import tempfile
import time
import unittest
spec = importlib.util.spec_from_file_location('ci_load', pathlib.Path(__file__).with_name('ci-load.py'))
load = importlib.util.module_from_spec(spec)
spec.loader.exec_module(load)
class LoadTest(unittest.TestCase):
@unittest.skipUnless(sys.platform == 'linux', 'real /proc lifecycle is Linux-only')
def test_cli_samples_and_stops_its_own_process(self):
with tempfile.TemporaryDirectory() as name:
output = pathlib.Path(name)/'load.tsv'
command = [sys.executable, '-I', str(pathlib.Path(__file__).with_name('ci-load.py'))]
try:
subprocess.run(command+['start', str(output), '--duration', '30'], check=True, timeout=10)
deadline = time.monotonic()+10
while time.monotonic() < deadline:
if output.exists() and len(output.read_text().splitlines()) >= 3:
break
time.sleep(0.05)
finally:
subprocess.run(command+['stop', str(output)], check=True, timeout=5)
lines = output.read_text().splitlines()
self.assertGreaterEqual(len(lines), 3)
self.assertTrue(lines[0].startswith('ts_utc\tload1\tsteal_pct'))
for line in lines[1:]:
fields = line.split('\t')
self.assertEqual(len(fields), 10)
self.assertTrue(fields[0].endswith('+00:00'))
for field in fields[1:]:
json.loads(field)
# The sampler exited: its pid is gone, and no incomplete note.
pid = json.loads(output.with_suffix('.pid.json').read_text())['pid']
self.assertFalse(pathlib.Path(f'/proc/{pid}').exists() and
pathlib.Path(f'/proc/{pid}/stat').read_text().split(')')[1].split()[0] != 'Z')
self.assertFalse(output.with_suffix('.incomplete').exists())
@unittest.skipUnless(sys.platform == 'linux', 'real /proc lifecycle is Linux-only')
def test_stop_records_a_sampler_that_does_not_exit(self):
with tempfile.TemporaryDirectory() as name:
output = pathlib.Path(name)/'load.tsv'
ready = pathlib.Path(name)/'ready'
stubborn = subprocess.Popen([sys.executable, '-c',
'import pathlib,signal,sys,time; signal.signal(signal.SIGTERM, signal.SIG_IGN); '
'pathlib.Path(sys.argv[1]).touch(); time.sleep(30)', str(ready)])
try:
deadline = time.monotonic()+10
while not ready.exists():
self.assertIsNone(stubborn.poll(), 'the stand-in exited before it was ready')
self.assertLess(time.monotonic(), deadline, 'the stand-in never became ready')
time.sleep(0.01)
output.with_suffix('.pid.json').write_text(json.dumps(dict(pid=stubborn.pid, start=load.identity(stubborn.pid))))
began = time.monotonic()
done = subprocess.run([sys.executable, '-I', str(pathlib.Path(__file__).with_name('ci-load.py')), 'stop', str(output)],
capture_output=True, text=True, timeout=10)
self.assertEqual(done.returncode, 0)
self.assertLess(time.monotonic()-began, 5)
self.assertIn('did not exit', output.with_suffix('.incomplete').read_text())
self.assertIn('load evidence incomplete', done.stderr)
finally:
stubborn.kill()
stubborn.wait()
def test_cpu_and_disk_interval_not_since_boot(self):
# CPU: 100 ticks, 10 iowait, 5 stolen. guest ticks are already in user.
before = {'cpu': [100, 0, 20, 800, 20, 0, 0, 10, 3, 0],
'disks': {'nvme0n1': [10, 30]}}
after = {'cpu': [130, 0, 25, 850, 30, 0, 0, 15, 7, 0],
'disks': {'nvme0n1': [14, 50], 'new': [1000, 9000]}}
cpu, disks = load.interval(before, after)
self.assertEqual(cpu, {'steal_pct': 5.0, 'iowait_pct': 10.0})
self.assertEqual(disks, {'nvme0n1': 5.0, 'new': None})
def test_reset_or_no_io_is_unknown_not_zero_latency(self):
before = {'cpu': [10]*8, 'disks': {'sda': [10, 100], 'sdb': [20, 200]}}
after = {'cpu': [1]*8, 'disks': {'sda': [10, 100], 'sdb': [1, 3]}}
cpu, disks = load.interval(before, after)
self.assertEqual(cpu, {'steal_pct': None, 'iowait_pct': None})
self.assertEqual(disks, {'sda': None, 'sdb': None})
def test_proc_fields_and_cgroup_ancestor_quota(self):
with tempfile.TemporaryDirectory() as name:
root = pathlib.Path(name)
(root/'pressure').mkdir()
(root/'self').mkdir()
mount = root/'cg'
(mount/'runner/job').mkdir(parents=True)
(mount/'cpu.max').write_text('max 100000\n')
(mount/'runner/cpu.max').write_text('200000 100000\n')
(mount/'runner/job/cpu.max').write_text('max 100000\n')
(root/'self/cgroup').write_text('0::/slice/runner/job\n')
(root/'self/mountinfo').write_text(f'1 0 0:1 /slice {mount.as_posix()} rw - cgroup2 cgroup rw\n')
(root/'loadavg').write_text('3.25 2.00 1.00 1/1 1\n')
(root/'stat').write_text('cpu 100 0 20 800 20 0 0 10 3 0\n')
(root/'diskstats').write_text('259 0 nvme0n1 2 0 0 6 3 0 0 9 0 0 0\n')
for kind in ('cpu', 'io', 'memory'):
(root/'pressure'/kind).write_text('some avg10=1.25 avg60=0.50 avg300=0.20 total=12345\n')
snapshot = load.read_snapshot(root)
self.assertEqual(snapshot['load1'], 3.25)
self.assertEqual(snapshot['disks'], {'nvme0n1': [5, 15]})
self.assertEqual(snapshot['psi']['cpu']['some']['total'], 12345)
self.assertEqual(snapshot['cpu_max'][str(mount/'runner/cpu.max')], '200000 100000')
self.assertEqual(snapshot['errors'], [])
(mount/'cpu.max').unlink()
snapshot = load.read_snapshot(root)
self.assertEqual(snapshot['cpu_max'][str(mount/'runner/cpu.max')], '200000 100000')
self.assertIsNone(snapshot['cpu_max'][str(mount/'cpu.max')])
self.assertTrue(snapshot['errors'])
def test_missing_inputs_explicitly_reported(self):
with tempfile.TemporaryDirectory() as name:
snapshot = load.read_snapshot(pathlib.Path(name))
self.assertIsNone(snapshot['load1'])
self.assertIsNone(snapshot['cpu'])
self.assertTrue(snapshot['errors'])
self.assertIsNone(snapshot['psi']['cpu'])
self.assertIsNone(snapshot['cpu_max'])
if __name__ == '__main__':
unittest.main()
-176
View File
@@ -1,176 +0,0 @@
"""One-second Linux job-load evidence. Missing counters are null, never zero.
Disk await is delta(read_ms + write_ms) / delta(completed reads + writes),
per device from diskstats (the r_await/w_await weighted mean, not a sum across
stacked devices). PSI retains the kernel's avg10/60/300 and total microseconds.
cpu.max includes every visible ancestor, since a parent may impose the quota.
The sampler is diagnostic only; it has a job-sized lifetime even if stop is lost.
"""
import argparse
import datetime
import json
import os
import pathlib
import re
import select
import signal
import subprocess
import sys
import threading
import time
def read_snapshot(proc=pathlib.Path('/proc')):
errors = []
def read(path, parse):
try:
return parse(path.read_text())
except (OSError, ValueError, IndexError, StopIteration) as error:
errors.append(str(path)+': '+str(error))
return None
def pressure(text):
return {parts[0]: {k: (int(v) if k == 'total' else float(v))
for k, v in (item.split('=') for item in parts[1:])}
for parts in (line.split() for line in text.splitlines()) if parts}
def diskstats(text):
result = {}
for line in text.splitlines():
fields = line.split()
# fields after the device name: reads, merges, sectors, ms,
# writes, merges, sectors, ms (present on all supported kernels).
result[fields[2]] = [int(fields[3])+int(fields[7]), int(fields[6])+int(fields[10])]
return result
def quotas(_):
group = next(line.split('::', 1)[1] for line in (proc/'self/cgroup').read_text().splitlines()
if line.startswith('0::'))
for line in (proc/'self/mountinfo').read_text().splitlines():
fields, filesystem = line.split(' - ', 1)
if filesystem.split()[0] != 'cgroup2':
continue
# mountinfo escapes whitespace and backslash with octal codes.
unescape = lambda value: re.sub(r'\\([0-7]{3})', lambda m: chr(int(m[1], 8)), value)
fields = fields.split()
base, mount = unescape(fields[3]), pathlib.Path(unescape(fields[4]))
if base != '/' and (group == base or group.startswith(base+'/')):
relative = group[len(base):].lstrip('/')
else:
# cgroup namespace: membership is relative to its visible root.
relative = group.lstrip('/')
current = mount / relative
current.relative_to(mount)
result = {}
while True:
path = current/'cpu.max'
# The real hierarchy root need not expose cpu.max. Preserve
# readable leaf/parent quotas even if another level is absent.
result[str(path)] = read(path, str.strip)
if current == mount:
return result
current = current.parent
raise ValueError('no visible cgroup v2 mount (v1 or unavailable)')
return dict(load1=read(proc/'loadavg', lambda text: float(text.split()[0])),
cpu=read(proc/'stat', lambda text: [int(v) for v in next(
line for line in text.splitlines() if line.startswith('cpu ')).split()[1:]]),
disks=read(proc/'diskstats', diskstats),
psi={kind: read(proc/'pressure'/filename, pressure) for kind, filename in
[('cpu', 'cpu'), ('io', 'io'), ('mem', 'memory')]},
cpu_max=read(proc/'self/cgroup', quotas), errors=errors)
def interval(before, after):
cpu = dict(steal_pct=None, iowait_pct=None)
old, new = before['cpu'], after['cpu']
if old is not None and new is not None and len(old) >= 8 and len(new) >= 8:
deltas = [new[i]-old[i] for i in range(8)] # guest already included in user/nice
total = sum(deltas)
if min(deltas) >= 0 and total > 0:
cpu = dict(steal_pct=100*deltas[7]/total, iowait_pct=100*deltas[4]/total)
disks = None
if after['disks'] is not None:
disks = {}
for name, values in after['disks'].items():
previous = (before['disks'] or {}).get(name)
disks[name] = None
if previous and values[0] > previous[0] and values[1] >= previous[1]:
disks[name] = (values[1]-previous[1])/(values[0]-previous[0])
return cpu, disks
def sample(output, duration):
output.parent.mkdir(parents=True, exist_ok=True)
previous = dict(cpu=None, disks=None)
end, due = time.monotonic()+duration, time.monotonic()
stopped = threading.Event()
signal.signal(signal.SIGTERM, lambda *_: stopped.set())
with output.open('w', buffering=1) as stream:
stream.write('ts_utc\tload1\tsteal_pct\tiowait_pct\tpsi_cpu\tpsi_io\tpsi_mem\tdisk_await_ms\tcgroup_cpu_max\terrors\n')
while not stopped.is_set() and time.monotonic() < end:
timestamp = datetime.datetime.now(datetime.timezone.utc).isoformat(timespec='milliseconds')
current = read_snapshot()
cpu, disks = interval(previous, current)
fields = [timestamp, current['load1'], cpu['steal_pct'], cpu['iowait_pct'],
current['psi']['cpu'], current['psi']['io'], current['psi']['mem'],
disks, current['cpu_max'], current['errors']]
stream.write('\t'.join(json.dumps(v, separators=(',', ':')) if not isinstance(v, str) else v
for v in fields)+'\n')
previous = current
due += 1
stopped.wait(max(0, min(due, end)-time.monotonic()))
# Do not emit a burst of fictitious one-second samples after a stall.
due = max(due, time.monotonic())
def identity(pid):
# comm may contain spaces or parentheses; starttime is field 22.
return pathlib.Path(f'/proc/{pid}/stat').read_text().rsplit(')', 1)[1].split()[19]
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('action', choices=['start', 'sample', 'stop'])
parser.add_argument('output', type=pathlib.Path)
parser.add_argument('--duration', type=int, default=5400)
args = parser.parse_args()
receipt = args.output.with_suffix('.pid.json')
if args.action == 'sample':
sample(args.output, args.duration)
elif args.action == 'start':
args.output.parent.mkdir(parents=True, exist_ok=True)
with args.output.with_suffix('.sampler.log').open('w') as log:
child = subprocess.Popen([sys.executable, '-I', str(pathlib.Path(__file__).resolve()),
'sample', str(args.output), '--duration', str(args.duration)],
stdin=subprocess.DEVNULL, stdout=log, stderr=log, start_new_session=True)
receipt.write_text(json.dumps(dict(pid=child.pid, start=identity(child.pid))))
elif receipt.exists():
owner = json.loads(receipt.read_text())
handle = None
try:
# A pidfd makes the identity-check/signal pair safe even if the
# process exits and its numeric PID is recycled between the two.
handle = os.pidfd_open(owner['pid'])
if identity(owner['pid']) == owner['start']:
signal.pidfd_send_signal(handle, signal.SIGTERM)
# Flush the last row before the uploader reads the file. Never
# signal a reused PID and never wait indefinitely for evidence.
# The pidfd turns readable when the sampler exits; one still
# alive after 2 s leaves load.incomplete beside its rows.
if not select.select([handle], [], [], 2)[0]:
note = args.output.with_suffix('.incomplete')
note.write_text('the sampler did not exit within 2 s of SIGTERM; its last rows may be missing\n')
print('load evidence incomplete: '+str(note), file=sys.stderr)
except ProcessLookupError:
pass
except FileNotFoundError:
pass
finally:
if handle is not None:
os.close(handle)
if __name__ == '__main__':
main()
-59
View File
@@ -1,59 +0,0 @@
#!/usr/bin/env bash
# Tests docs-only-scope.sh against real commits, and that test.yml applies it
# only to the process suite of a pull request. Any failure exits nonzero.
set -euo pipefail
here=$(cd "$(dirname "$0")" && pwd)
scope="$here/docs-only-scope.sh"
workflow="$here/../workflows/test.yml"
fail=0
check() { # name want got
if [ "$2" = "$3" ]; then echo "ok $1"; else echo "FAIL $1: want [$2], got [$3]"; fail=1; fi
}
repo=$(mktemp -d)
trap 'rm -rf "$repo"' EXIT
cd "$repo"
git init -q
git config user.email t@example.invalid
git config user.name t
git config core.autocrlf false
mkdir -p docs cmd
echo a >docs/a.md
echo r >README.md
echo g >cmd/main.go
git add -A
git commit -qm base
base=$(git rev-parse HEAD)
case_of() { # name want: commit the current tree, classify against base, reset
git add -A
git commit -qm "$1" --allow-empty
check "$1" "$2" "$(bash "$scope" "$base" HEAD)"
git reset -q --hard "$base"
}
echo b >docs/b.md; echo a2 >docs/a.md
case_of "two docs files" "docs_only 2"
echo b >docs/b.md; echo t >cmd/x_test.go
case_of "docs and a test file" "run 2 cmd/x_test.go"
case_of "no file changed" "run 0"
mkdir -p docs-old; echo x >docs-old/x.md
case_of "a docs-like prefix" "run 1 docs-old/x.md"
echo r2 >README.md
case_of "README outside docs" "run 1 README.md"
git mv docs/a.md cmd/a.md
case_of "a move out of docs" "run 2 cmd/a.md"
git rm -q docs/a.md
case_of "a docs deletion" "docs_only 1"
for i in $(seq 1 20000); do printf 'x\n' >"docs/f$i.md"; done
echo late >zz-late.go
case_of "20000 docs files and one other, listed last" "run 20001 zz-late.go"
if out=$(bash "$scope" "$base" no-such-revision 2>/dev/null); then
check "an unknown revision is an error" "nonzero exit" "exit 0: $out"
else
check "an unknown revision is an error" "nonzero exit" "nonzero exit"
fi
# test.yml: the scope step runs only for a pull request's process suite, and
# every process step it can skip names its output.
step=$(grep -n -A3 'name: Docs-only pull request' "$workflow" | grep "if:" || true)
check "scope step condition" "1" "$(printf '%s' "$step" | grep -c "matrix.suite == 'process' && github.event_name == 'pull_request'" || true)"
check "process steps gated" "5" "$(grep -c "if: matrix.suite == 'process' && steps.scope.outputs.docs_only != '1'" "$workflow" || true)"
check "no ungated process step" "0" "$(grep -c "if: matrix.suite == 'process'$" "$workflow" || true)"
exit "$fail"
-32
View File
@@ -1,32 +0,0 @@
#!/usr/bin/env bash
# docs-only-scope.sh BASE HEAD: classifies the files changed between BASE and
# HEAD for the process-level suite. It prints one line:
# "docs_only N" every one of the N changed files is under docs/
# "run N [FIRST-OTHER]" no file changed, or at least one is elsewhere
# and exits 0. Any error (git fails, the list cannot be read) exits nonzero,
# and the caller then runs the tests: an error never selects docs_only.
#
# The NUL-delimited list is written to a file first and read to its end, so
# no pipe can stop early and leave a writer's error looking like an answer.
set -euo pipefail
[ "$#" -eq 2 ] || { echo "usage: docs-only-scope.sh BASE HEAD" >&2; exit 2; }
list=$(mktemp)
trap 'rm -f "$list"' EXIT
if ! git diff --name-only --no-renames -z "$1" "$2" >"$list"; then
echo "docs-only-scope: git diff $1 $2 failed" >&2
exit 2
fi
n=0
other=""
while IFS= read -r -d '' f; do
n=$((n + 1))
case $f in
docs/*) ;;
*) [ -n "$other" ] || other=$f ;;
esac
done <"$list"
if [ "$n" -gt 0 ] && [ -z "$other" ]; then
echo "docs_only $n"
else
echo "run $n${other:+ $other}"
fi
-58
View File
@@ -1,58 +0,0 @@
"""Drain a Go stream even when recording/rendering fails; never judge tests."""
import json
import os
import sys
sys.stdin.reconfigure(encoding='utf-8', errors='replace')
def warn(error):
try:
print('test evidence unavailable: '+str(error), file=sys.stderr)
except OSError:
pass
archive = None
try:
archive = open(sys.argv[1], 'a', encoding='utf-8', buffering=1)
except OSError as error:
warn(error)
raw = len(sys.argv) > 2 and sys.argv[2] == '--raw'
console = True
for line in sys.stdin:
if archive is not None:
try:
archive.write(line)
except OSError as error:
warn(error)
try:
archive.close()
except OSError:
pass
archive = None
output = line
if not raw:
try:
output = json.loads(line).get('Output', '')
except (ValueError, AttributeError) as error:
# Keep and display unexpected text, but keep draining the producer.
warn(error)
if console:
try:
sys.stdout.write(output)
sys.stdout.flush()
except OSError:
console = False
# Avoid an interpreter-exit BrokenPipe flush; the stream still
# drains Go to EOF so a dead console cannot send SIGPIPE upstream.
try:
with open(os.devnull, 'w') as sink:
os.dup2(sink.fileno(), sys.stdout.fileno())
except OSError:
pass
if archive is not None:
try:
archive.close()
except OSError as error:
warn(error)
-73
View File
@@ -1,73 +0,0 @@
#!/usr/bin/env bash
# Controls for lab-tag-check.sh and scripts/refuse-lab-binary.sh. Each case
# builds a small git repository from the real image recipes and publish
# workflow with one contamination, and expects a refusal; the unchanged copy
# passes. The refusal script is driven with stand-in binaries. Exit 0 when
# every control holds.
set -euo pipefail
here=$(cd "$(dirname "$0")" && pwd)
src=$(cd "$here/../.." && pwd)
check="$here/lab-tag-check.sh"
refuse="$src/scripts/refuse-lab-binary.sh"
t=$(mktemp -d); trap 'rm -rf -- "${t:?}"' EXIT
tag=swblock_lab_bigvol
sw=deploy/k8s/g15b/Dockerfile.sw-block
csi=deploy/k8s/g15b/Dockerfile.blockcsi
pub=.github/workflows/publish-alpha-images.yml
n=0
gadd() { git -C "$r" -c core.autocrlf=false -c core.safecrlf=false add -A; }
repo() { # the real recipes and publish workflow, plus one allowed file, in $t/r<n>
n=$((n+1)); r="$t/r$n"
mkdir -p "$r/deploy/k8s/g15b" "$r/.github/workflows" "$r/core/geometry" "$r/core/x"
tr -d '\r' < "$src/$sw" > "$r/$sw"
tr -d '\r' < "$src/$csi" > "$r/$csi"
tr -d '\r' < "$src/$pub" > "$r/$pub"
printf '//go:build %s\npackage geometry\n' "$tag" > "$r/core/geometry/volume_size_lab.go"
printf 'package x\n' > "$r/core/x/x.go"
git -C "$r" init -q && gadd
}
edit() { # edit FILE SED: change one file of the current repository
sed -i "$2" "$r/$1" && gadd
}
expect() { # expect pass|fail name
local want=$1 name=$2 rc=0
bash "$check" "$r" >/dev/null 2>&1 || rc=$?
if [ "$want" = pass ] && [ $rc -ne 0 ]; then echo "FAIL: $name: refused"; bash "$check" "$r" || true; exit 1; fi
if [ "$want" = fail ] && [ $rc -eq 0 ]; then echo "FAIL: $name: passed"; exit 1; fi
}
repo; expect pass "the real recipes, unchanged"
repo; printf '// %s\npackage x\n' "$tag" > "$r/core/x/x.go"; gadd; expect fail "the tag outside the allowlist"
repo; printf '// swblock_v11_format
package x
' > "$r/core/x/x.go"; gadd; expect fail "the format tag outside the allowlist"
repo; edit "$sw" "s#go build -o /out/blockvolume#go build -tags swblock_v11_format -o /out/blockvolume#"; expect fail "the format tag in a real recipe's build"
repo; edit "$sw" "s#go build -o /out/blockvolume#go build -tags $tag -o /out/blockvolume#"; expect fail "the tag in a real recipe's build"
repo; edit "$sw" '/^RUN bash scripts\/refuse-lab-binary.sh/d'; expect fail "the real recipe's RUN guard deleted, its comment kept"
repo; edit "$csi" '/^RUN bash scripts\/refuse-lab-binary.sh/d'; expect fail "the CSI recipe's RUN guard deleted, its comment kept"
repo; edit "$sw" 's#^RUN bash scripts/refuse-lab-binary.sh#\# RUN bash scripts/refuse-lab-binary.sh#'; expect fail "the RUN guard commented out"
repo; edit "$sw" 's#^\(RUN bash scripts/refuse-lab-binary.sh.*\) /out/sw-block#\1#'; expect fail "a built binary left out of the refusal"
repo; edit "$sw" 's#/out/blockvolume ./cmd/blockvolume#/out/blockvolume ./cmd/blockvolume \&\& \\n CGO_ENABLED=0 go build -o /out/extra ./cmd/extra#'; expect fail "a new binary built and not refused"
repo; guard=$(grep '^RUN bash scripts/refuse-lab-binary.sh' "$r/$sw"); edit "$sw" '/^RUN bash scripts\/refuse-lab-binary.sh/d'; sed -i "s#^RUN CGO_ENABLED=0 go build#$guard\nRUN CGO_ENABLED=0 go build#" "$r/$sw"; gadd; expect fail "the refusal before the build"
repo; printf ' - run: go build ./...\n' >> "$r/$pub"; gadd; expect fail "a go build in the publish workflow"
repo; edit "$pub" "s#file: $csi#file: Dockerfile.root#"; printf 'RUN go build -o /out/b ./cmd/b\n' > "$r/Dockerfile.root"; gadd; expect fail "publishing from a Dockerfile outside deploy/"
repo; rm -f "$r/$pub"; gadd; expect fail "no readable publish workflow"
repo; ln -s missing-target "$r/deploy/k8s/g15b/Dockerfile.dangling" 2>/dev/null || true
if [ -L "$r/deploy/k8s/g15b/Dockerfile.dangling" ]; then gadd; expect fail "an image Dockerfile that cannot be read"; else echo "note: no symlinks here; the unreadable-recipe control runs on Linux"; fi
r="$t/missing"; expect fail "a missing repository"
r="$t/notgit"; mkdir -p "$r"; expect fail "a directory the scan cannot read as a repository"
b="$t/bin"; mkdir -p "$b"
printf '#!/bin/sh\necho "b revision=1 modified=false"\n' > "$b/release"
printf '#!/bin/sh\necho "b revision=1 modified=false LAB BUILD(%s)"\n' "$tag" > "$b/lab"
printf '#!/bin/sh
echo "b revision=1 modified=false LAB BUILD(swblock_v11_format)"
' > "$b/draft"
printf '#!/bin/sh\nexit 3\n' > "$b/broken"
printf '#!/bin/sh\nexit 0\n' > "$b/silent"
chmod +x "$b"/*
bash "$refuse" "$b/release" >/dev/null || { echo "FAIL: refuse-lab-binary refused a release binary"; exit 1; }
for x in lab draft broken silent; do
if bash "$refuse" "$b/release" "$b/$x" >/dev/null 2>&1; then echo "FAIL: refuse-lab-binary passed a $x binary"; exit 1; fi
done
if bash "$refuse" >/dev/null 2>&1; then echo "FAIL: refuse-lab-binary passed with no binary"; exit 1; fi
echo "lab-tag-check controls: OK ($n repositories, 5 binaries)"
-90
View File
@@ -1,90 +0,0 @@
#!/usr/bin/env bash
# The lab-only build tags must never reach an image or a release build:
# swblock_lab_bigvol lifts the 256 GiB create cap and the local headroom
# refusal for scale rehearsals; swblock_v11_format turns on the draft v1.1
# store format. Two checks, both failing closed:
# 1. Allowlist: only the files below may name either tag (git grep over the
# tracked tree; a scan that cannot run is a failure, never "clean").
# 2. Wiring: every image Dockerfile under deploy/ that runs go build also runs
# scripts/refuse-lab-binary.sh after its last go build, and the publish
# workflow builds images only from such Dockerfiles, with no go build of
# its own.
# Usage: lab-tag-check.sh [REPO_ROOT] Exit 0: clean. Exit 1: a finding or an
# unreadable input (printed).
set -euo pipefail
root=${1:-.}
tags='swblock_lab_bigvol swblock_v11_format'
allowed='.github/scripts/lab-tag-check-test.sh
.github/scripts/lab-tag-check.sh
.github/workflows/test.yml
core/host/volume/status_heap_lab.go
core/host/volume/status_heap_lab_test.go
core/host/volume/status_heap_release.go
core/host/volume/status_heap_release_test.go
core/storage/chunk_v11_format_draft.go
core/storage/chunk_v11_format_release.go
core/storage/chunk_v11_format_tag_test.go
core/frontend/durable/headroom.go
core/frontend/durable/headroom_lab_test.go
core/geometry/volume_size.go
core/geometry/volume_size_lab.go
core/geometry/volume_size_lab_test.go
core/geometry/volume_size_release.go
core/geometry/volume_size_release_test.go
docs/design/invariants.md
docs/lab-heap-profiles.md
internal/buildinfo/buildinfo.go
internal/buildinfo/v11_format_draft.go
internal/buildinfo/v11_format_release.go
scripts/refuse-lab-binary.sh'
fail() { echo "lab-tag: $*" >&2; exit 1; }
[ -d "$root" ] || fail "no repository at $root"
for tag in $tags; do
set +e
hits=$(git -C "$root" grep -l -- "$tag")
rc=$?
set -e
case $rc in
0) ;;
1) hits="" ;;
*) fail "git grep failed (rc=$rc): the scan did not run" ;;
esac
bad=""
while IFS= read -r f; do
[ -n "$f" ] || continue
printf '%s\n' "$allowed" | grep -qxF -- "$f" || bad="$bad $f"
done <<< "$hits"
[ -z "$bad" ] || fail "$tag named outside the allowlist:$bad"
done
# read FILE: its whole content, once; a read that fails is a failure, never
# "no match".
read_file() { local c; c=$(cat -- "$root/$1") || fail "cannot read $1"; printf '%s\n' "$c"; }
dockerfiles=$(cd "$root" && find deploy \( -type f -o -type l \) -name 'Dockerfile*' | sort) || fail "cannot list deploy/"
[ -n "$dockerfiles" ] || fail "no image Dockerfile under deploy/"
for d in $dockerfiles; do
body=$(read_file "$d") || exit 1
# The binaries it builds (go build ... -o /out/NAME), and the line of its
# last build. A recipe that builds nothing needs no refusal.
built=$(printf '%s\n' "$body" | grep -oE 'go build[^&\]*-o /out/[A-Za-z0-9_.-]+' | grep -oE '/out/[A-Za-z0-9_.-]+$' | sort -u) || true
[ -n "$built" ] || continue
last=$(printf '%s\n' "$body" | grep -nE 'go build' | tail -1 | cut -d: -f1)
# The refusal must be an executed RUN line (not a comment) after the last
# build, naming every binary the recipe builds.
refuse=$(printf '%s\n' "$body" | grep -nE '^RUN bash scripts/refuse-lab-binary\.sh( |$)' | tail -1) || fail "$d builds ${built//$'\n'/ } without a RUN of scripts/refuse-lab-binary.sh"
at=${refuse%%:*}
[ "$at" -gt "$last" ] || fail "$d runs the refusal before its last build"
for b in $built; do
case " ${refuse#*:} " in *" $b "*) ;; *) fail "$d does not refuse $b, which it builds" ;; esac
done
done
pub=.github/workflows/publish-alpha-images.yml
pubbody=$(read_file "$pub") || exit 1
case "$pubbody" in *"go build"*) fail "the publish workflow runs its own go build" ;; esac
files=$(printf '%s\n' "$pubbody" | grep -E '^[[:space:]]*file:' | sed -E 's/^[[:space:]]*file:[[:space:]]*//') || fail "the publish workflow names no Dockerfile"
for f in $files; do
printf '%s\n' "$dockerfiles" | grep -qxF -- "$f" || fail "the publish workflow builds from $f, not an image Dockerfile under deploy/"
fbody=$(read_file "$f") || exit 1
printf '%s\n' "$fbody" | grep -qE '^RUN bash scripts/refuse-lab-binary\.sh ' || fail "the publish workflow builds from $f, which does not run the refusal"
done
echo "lab-tag: clean"
-120
View File
@@ -1,120 +0,0 @@
"""Check that every code and test anchor of the invariants ledger exists at a git ref.
usage: python -I ledger_check.py <repo-dir> <git-ref> [<ledger path in repo>]
A ledger row is a table line whose first cell holds `INV-...`. In its cells, a
backticked token that ends in .go is a FILE; a backticked identifier (or
Type.Method) is a SYMBOL of the nearest file named before it in the same cell,
or, in the test cell, of any file named in that cell. A file must exist at the
ref; a symbol must occur in its file as a whole word (for a test: `func Name(`).
A symbol with no file in its cell is looked up in the whole tree. A file may
be a glob (`volume_lock*.go`). A lower-case token with an underscore (a build
tag, a JSON key, a reason string) is not a Go symbol and is not checked.
Prints one line per missing anchor and a summary. It reads; it changes nothing.
Exit: 0 when every anchor exists; 1 when one is missing; 2 when git fails or no
row or anchor was found (an error is never read as a pass).
"""
import re
import subprocess
import sys
def git(repo, *args):
"""git's output. A git failure ends the check with exit 2: an error must
never read as "no anchors". `git grep` finding nothing (exit 1) is not one."""
r = subprocess.run(["git", "-C", repo] + list(args), capture_output=True, text=True,
encoding="utf-8", errors="replace")
if r.returncode != 0 and not (args and args[0] == "grep" and r.returncode == 1):
print("ledger_check: git %s failed (exit %d): %s" % (" ".join(args[:2]), r.returncode, r.stderr.strip()[:300]),
file=sys.stderr)
sys.exit(2)
return r.stdout
def main():
repo, ref = sys.argv[1], sys.argv[2]
ledger = sys.argv[3] if len(sys.argv) > 3 else "docs/design/invariants.md"
text = git(repo, "show", "%s:%s" % (ref, ledger))
files = set(git(repo, "ls-tree", "-r", "--name-only", ref).split("\n"))
cache = {}
def body(path):
if path not in cache:
cache[path] = git(repo, "show", "%s:%s" % (ref, path))
return cache[path]
def resolve(tok):
"""A file token may be a full path or a bare file name."""
if tok in files:
return [tok]
if "*" in tok:
rx = re.compile("^(.*/)?" + "[^/]*".join(re.escape(x) for x in tok.split("*")) + "$")
return [f for f in files if rx.match(f)]
if "/" not in tok:
return [f for f in files if f.endswith("/" + tok)]
# a path with a directory matches whole path components only
return [f for f in files if f.endswith("/" + tok)]
ident = re.compile(r"^[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)?(\(\))?$")
go_all = None
rows = missing = anchors = 0
for n, line in enumerate(text.split("\n"), 1):
if not line.startswith("|"):
continue
cells = [c.strip() for c in line.strip().strip("|").split("|")]
m = re.match(r"`(INV-[A-Z0-9-]+)`", cells[0]) if cells else None
if not m or len(cells) < 6:
continue
rows += 1
inv, status = m.group(1), cells[-1]
if "ARCHIVED" in status:
continue
for ci, kind in ((3, "code"), (4, "test")):
toks = re.findall(r"`([^`]+)`", cells[ci])
cell_files = []
for t in toks:
if t.endswith(".go"):
cell_files.append(t)
cur = None
for t in toks:
if t.endswith(".go"):
cur = t
anchors += 1
if not resolve(t):
missing += 1
print("%s (line %d, %s, %s): file %s does not exist" % (inv, n, kind, status, t))
continue
if not ident.match(t):
continue
sym = t.rstrip("()").split(".")[-1]
if sym in ("nil", "true", "false") or sym.isupper() or len(sym) < 3:
continue
if "_" in sym and sym == sym.lower():
# a build tag, a JSON key or a reason string: not a Go symbol
continue
scope = [cur] if (cur and kind == "code") else cell_files
paths = [p for f in scope for p in resolve(f)]
anchors += 1
if kind == "test" and sym.startswith(("Test", "Fuzz", "Benchmark")):
pat = re.compile(r"func %s\(" % re.escape(sym))
else:
pat = re.compile(r"\b%s\b" % re.escape(sym))
if paths:
ok = any(pat.search(body(p)) for p in paths)
else:
if go_all is None:
go_all = git(repo, "grep", "-h", "-E", r"^(func|type|var|const|\s+[A-Za-z_]+\s)", ref, "--", "*.go")
ok = bool(pat.search(go_all))
if not ok:
missing += 1
where = ", ".join(scope) if scope else "the tree"
print("%s (line %d, %s, %s): %s not found in %s" % (inv, n, kind, status, t, where))
print("%d rows, %d anchors, %d missing at %s" % (rows, anchors, missing, ref))
if rows == 0 or anchors == 0:
print("ledger_check: no ledger rows or anchors found: refusing to pass", file=sys.stderr)
sys.exit(2)
sys.exit(1 if missing else 0)
if __name__ == "__main__":
main()
-77
View File
@@ -1,77 +0,0 @@
#!/usr/bin/env python3
import importlib.util
from pathlib import Path
import subprocess
import sys
import tempfile
import unittest
SCRIPT = Path(__file__).with_name("model-trace-check.py")
spec = importlib.util.spec_from_file_location("model_trace", SCRIPT)
checker = importlib.util.module_from_spec(spec)
spec.loader.exec_module(checker)
class ModelTraceTests(unittest.TestCase):
mapping = {"core/a.go": {"EngineAdapter.Begin", "EngineAdapter.NoOpCut"}, "core/b.go": {"MoveAdmission.Revoke"}}
def test_each_mapped_file_needs_its_own_citation(self):
problems = checker.check("EngineAdapter.Begin", ["core/a.go", "core/b.go"], self.mapping)
self.assertEqual(len(problems), 1)
self.assertIn("core/b.go", problems[0])
self.assertEqual(checker.check("EngineAdapter.Begin; MoveAdmission.Revoke", list(self.mapping), self.mapping), [])
def test_mapped_file_refuses_free_text_wrong_actions_and_lookalikes(self):
for model in ("exhausted", "EngineAdapter.Unknown", "Other.Begin", "EngineAdapter.BeginExtra",
"docs/EngineAdapter.Begin", "example: EngineAdapter.Begin", "NONE: no state changes",
"NONE (pure function of Other)", "NONE (pure function of EngineAdapter) extra"):
with self.subTest(model=model):
self.assertEqual(len(checker.check(model, ["core/a.go"], self.mapping)), 1)
def test_pure_function_exception_is_module_specific(self):
self.assertEqual(checker.check("NONE (pure function of EngineAdapter)", ["core/a.go"], self.mapping), [])
self.assertEqual(len(checker.check("NONE (pure function of EngineAdapter)", ["core/b.go"], self.mapping)), 1)
def test_unmapped_files_keep_existing_policy(self):
self.assertEqual(checker.check("existing prose", ["docs/a.md", "core/a.go.bak"], self.mapping), [])
def test_repository_map_covers_claimed_head_create(self):
mapping = checker.read_mapping(SCRIPT.parent.parent / "model-code-trace.tsv")
paths = ["core/frontend/chunkstore/layout/create.go"]
self.assertEqual(checker.check("VolumeCreate.Claim", paths, mapping), [])
self.assertEqual(len(checker.check("VolumeCreate.Unknown", paths, mapping)), 1)
def test_repository_map_covers_the_replica_receiver(self):
mapping = checker.read_mapping(SCRIPT.parent.parent / "model-code-trace.tsv")
paths = ["core/transport/replica.go"]
self.assertEqual(checker.check("ReplicationPeer.Ship", paths, mapping), [])
self.assertEqual(len(checker.check("VolumeCreate.Claim", paths, mapping)), 1)
def test_cli_checks_nul_paths_and_model_citations(self):
with tempfile.TemporaryDirectory() as tmp:
mapping = Path(tmp) / "map.tsv"
mapping.write_text("# exact paths\ncore/a.go\tEngineAdapter.Begin\n", encoding="utf-8")
def run(model, paths):
return subprocess.run([sys.executable, str(SCRIPT), str(mapping), model],
input=paths, capture_output=True).returncode
self.assertEqual(run("EngineAdapter.Begin", b"core/a.go\0"), 0)
self.assertEqual(run("unstructured prose", b"core/a.go\0"), 1)
self.assertEqual(run("EngineAdapter.Begin", b"core/a.go"), 2)
self.assertEqual(run("EngineAdapter.Begin", b"\0"), 2)
def test_mapping_refuses_missing_empty_and_malformed_data(self):
with tempfile.TemporaryDirectory() as tmp:
mapping = Path(tmp) / "map.tsv"
with self.assertRaises(OSError):
checker.read_mapping(mapping)
for content in ("# not populated\n", "core/a.go EngineAdapter.Begin\n",
"../core/a.go\tEngineAdapter.Begin\n", "core//a.go\tEngineAdapter.Begin\n",
"core/a.go\tKernel\n", "core/a.go\tEngineAdapter.Begin extra\n"):
with self.subTest(content=content):
mapping.write_text(content, encoding="utf-8")
with self.assertRaises(ValueError):
checker.read_mapping(mapping)
if __name__ == "__main__":
unittest.main()
-72
View File
@@ -1,72 +0,0 @@
#!/usr/bin/env python3
"""Check Model citations against a base-owned, exact-path TSV mapping."""
import re
import sys
from pathlib import Path, PurePosixPath
IDENT = r"[A-Za-z_][A-Za-z0-9_]*"
ACTION = re.compile(rf"{IDENT}\.{IDENT}")
PURE = re.compile(rf"NONE \(pure function of ({IDENT})\)")
def read_mapping(path):
mapping = {}
for number, line in enumerate(Path(path).read_text(encoding="utf-8").splitlines(), 1):
if not line.strip() or line.startswith("#"):
continue
columns = line.split("\t")
if len(columns) != 2:
raise ValueError(f"mapping line {number}: expected PATH<TAB>Module.Action")
file, action = columns
parts = PurePosixPath(file).parts
if (not file or file.startswith("/") or "\\" in file or ":" in file
or any(part in (".", "..") for part in file.split("/"))
or str(PurePosixPath(file)) != file or not parts):
raise ValueError(f"mapping line {number}: expected a repository-relative exact path")
if not ACTION.fullmatch(action):
raise ValueError(f"mapping line {number}: invalid Module.Action")
mapping.setdefault(file, set()).add(action)
if not mapping:
raise ValueError("model mapping is empty; populate it before enabling this gate")
return mapping
def check(model, paths, mapping):
# A list permits one citation for each mapped file in a multi-module PR.
# Full matches prevent prose, quoted examples, or a prefixed NONE excuse
# from accidentally satisfying a mapped-file obligation.
citations = {part.strip() for part in model.split(";")}
actions = {part for part in citations if ACTION.fullmatch(part)}
pure = {match.group(1) for part in citations if (match := PURE.fullmatch(part))}
problems = []
for file in sorted(set(paths)):
expected = mapping.get(file)
if expected and not (actions & expected or any(a.split(".")[0] in pure for a in expected)):
names = "; ".join(sorted(expected))
problems.append(f"{file}: Model must cite {names} or NONE (pure function of its module)")
return problems
def main():
if len(sys.argv) != 3:
print("usage: model-trace-check.py MAPPING MODEL < nul-separated-paths", file=sys.stderr)
return 2
try:
mapping = read_mapping(sys.argv[1])
raw = sys.stdin.buffer.read()
if raw and not raw.endswith(b"\0"):
raise ValueError("unterminated changed path")
paths = [p.decode("utf-8") for p in raw.split(b"\0")[:-1]]
if any(not p for p in paths):
raise ValueError("empty changed path")
problems = check(sys.argv[2], paths, mapping)
except (OSError, UnicodeError, ValueError) as error:
print(f"spec-trace: {error}", file=sys.stderr)
return 2
for problem in problems:
print(f"spec-trace: {problem}")
return int(bool(problems))
if __name__ == "__main__":
sys.exit(main())
@@ -1,10 +0,0 @@
#!/usr/bin/env bash
# Usage: post-merge-review-changed.sh BASE HEAD
#
# Writes what a PR changes (BASE...HEAD) as NUL-separated STATUS, PATH pairs,
# unquoted, so any byte in a name reaches the check as itself. --no-renames
# reports a move as a delete of the old name and an add of the new one.
set -euo pipefail
base=${1:?usage: post-merge-review-changed.sh BASE HEAD}
head=${2:?usage: post-merge-review-changed.sh BASE HEAD}
exec git diff -z --name-status --no-renames "$base...$head"
@@ -1,197 +0,0 @@
#!/usr/bin/env bash
# Self-test of the post-merge-review check: the matcher against the checked-in
# allow list, the real Git diff it consumes, and the workflow's triggers.
set -euo pipefail
shopt -s inherit_errexit
here=$(cd "$(dirname "$0")" && pwd)
check=$here/post-merge-review-check.sh
changed=$here/post-merge-review-changed.sh
allow=$here/../post-merge-review-allow.txt
workflow=$here/../workflows/post-merge-review.yml
fail=0
expect_changes() { # expect_changes WANT_EXIT NAME [STATUS PATH]...
local want=$1 name=$2
shift 2
local got=0
if (($#)); then printf '%s\0' "$@"; fi | bash "$check" "$allow" >/dev/null || got=$?
if [[ $got != "$want" ]]; then
echo "FAIL $name: exit $got, want $want"
fail=1
fi
}
expect() { # expect WANT_EXIT NAME PATH... : each path modified
local want=$1 name=$2 p
shift 2
local args=()
for p in "$@"; do args+=(M "$p"); done
expect_changes "$want" "$name" ${args[@]+"${args[@]}"}
}
# Allowed.
expect 0 "docs" docs/README.md README.md cmd/sw-block/NOTES.md
expect 0 "testops docs" internal/testops/registry-overview.md
expect 0 "test outside denied dirs" core/ops/cleanup_projection_test.go cmd/blockmaster/topology_test.go
expect 0 "named status files" core/host/master/observation_service.go core/host/volume/memory_status.go
expect 0 "release is not lease" cmd/sw-block/release_test.go
expect 0 "names with a space, tab or newline" "docs/a b.md" $'docs/a\tb.md' $'docs/a\nb.md'
expect 0 "no paths"
expect_changes 0 "test added" A cmd/foo/new_test.go
expect_changes 0 "doc deleted" D docs/old.md
# Denied by default: not on the allow list.
expect 1 "new file anywhere" core/newpkg/decide.go
expect 1 "decision code by name" core/host/master/product_loop.go core/lifecycle/planner.go
expect 1 "go.mod" go.mod
expect 1 "go.sum" go.sum
expect 1 "status-like but not named" core/ops/operator_status_controller.go
expect 1 "status server: registers a mutating endpoint" core/host/volume/status_server.go
# Denied explicitly, even where an allow line matches.
expect 1 "storage" core/storage/walstore.go
expect 1 "unicode name in storage" $'core/storage/\xc3\xa9_test.go'
expect 1 "durable test file" core/frontend/durable/provider_chunk_detach_abort_test.go
expect 1 "doc inside a denied dir" core/storage/NOTES.md
expect 1 "authority test" core/authority/lease_stats_test.go
expect 1 "master workspace test" core/host/master/workspace_binding_review_test.go
expect 1 "volume workspace runtime" core/host/volume/workspace_runtime.go
expect 1 "volume workspace runtime test" core/host/volume/workspace_runtime_test.go
expect 1 "proto" core/rpc/proto/control.proto
expect 1 "lease test by name" cmd/foo/lease_table_test.go
expect 1 "gc test by name" cmd/sw-block/chunk_gc_test.go
expect 1 "the check itself" .github/post-merge-review-allow.txt
expect 1 "a workflow" .github/workflows/test.yml
expect 1 "PR template under .github" .github/pull_request_template.md
expect 1 "mixed: allowed plus denied" docs/README.md core/storage/walstore.go
expect 1 "mixed: allowed plus unlisted" docs/README.md go.mod
# Persisted-format, GC and delete paths stay denied, tests included.
expect 1 "lifecycle store test" core/lifecycle/store_test.go
expect 1 "journal isolation test" core/host/master/journal_isolation_test.go
expect 1 "sparrow persist test" cmd/sparrow/persist_sidecar_test.go
expect 1 "chunk volume delete test" cmd/sw-block/chunk_volume_delete_test.go
expect 1 "deletion reservations test" core/lifecycle/deletion_reservations_test.go
expect 1 "delete safety contract test" core/ops/delete_safety_contract_test.go
expect 1 "gc doc" docs/spec/cfg/RED_gc_ageonly.cfg
# The test gates: engine, CLI and gate definitions (and their tests).
expect 1 "testops engine" internal/testops/control.go
expect 1 "testops engine test" internal/testops/control_test.go
expect 1 "testops gate definition" internal/testops/registry/iscsi-p2-os-smoke.json
expect 1 "testops CLI" cmd/sw-testops/main.go
# A test may be added or modified, never deleted or replaced.
expect_changes 1 "test deleted" D cmd/foo/guard_test.go
expect_changes 1 "test type changed" T cmd/foo/guard_test.go
expect_changes 1 "test moved (delete plus add)" D cmd/foo/guard_test.go A cmd/foo/renamed_test.go
# A malformed change list or a missing or empty allow list fails closed.
malformed() { # malformed NAME PRINTF-FORMAT
local got=0
printf "$2" | bash "$check" "$allow" >/dev/null 2>&1 || got=$?
[[ $got == 2 ]] || { echo "FAIL malformed list, $1: exit $got, want 2"; fail=1; }
}
malformed "status without a path" 'M\0'
malformed "bare unterminated status" 'M'
malformed "trailing partial status after a valid pair" 'M\0docs/x.md\0D'
malformed "unterminated path" 'M\0docs/x.md'
malformed "unknown status" 'BOGUS\0docs/x.md\0'
malformed "rename status (renames are off)" 'R100\0docs/x.md\0'
malformed "empty status" '\0docs/x.md\0'
malformed "empty path" 'M\0\0'
empty=$(mktemp)
for bad in "$empty" "/nonexistent/post-merge-review-allow.txt"; do
got=0
printf 'M\0docs/README.md\0' | bash "$check" "$bad" >/dev/null 2>&1 || got=$?
[[ $got == 2 ]] || { echo "FAIL allow list $bad: exit $got, want 2"; fail=1; }
done
rm -f "$empty"
# A list whose last line has no newline keeps that line (here a denial).
unterminated=$(mktemp)
printf '*_test.go\n!core/workspace/*' >"$unterminated"
got=0
printf 'M\0core/workspace/orch_test.go\0' | bash "$check" "$unterminated" >/dev/null 2>&1 || got=$?
[[ $got == 1 ]] || { echo "FAIL allow list with an unterminated last line: exit $got, want 1"; fail=1; }
got=0
printf 'M\0cmd/foo/a_test.go\0' | bash "$check" "$unterminated" >/dev/null 2>&1 || got=$?
[[ $got == 0 ]] || { echo "FAIL allow list with an unterminated last line, allowed path: exit $got, want 0"; fail=1; }
rm -f "$unterminated"
# Real Git: names that git quotes in its default output, a rename out of a
# denied directory, a retarget onto a base that differs, and test deletes.
repo=$(mktemp -d)
trap 'rm -rf "$repo" "${changes:-}"' EXIT
g() { git -C "$repo" -c user.name=t -c user.email=t@t -c core.quotePath=true -c core.protectNTFS=false "$@"; }
blob=
commit() { # commit PARENT PATH... : PARENT's tree plus PATHs (-PATH removes)
local parent=$1
shift
g read-tree "$parent"
local p
for p in "$@"; do
if [[ $p == -* ]]; then
g update-index --force-remove -- "${p#-}"
else
g update-index --add --cacheinfo "100644,$blob,$p"
fi
done
g commit-tree "$(g write-tree)" -p "$parent" -m c
}
changes=$(mktemp)
expect_diff() { # expect_diff WANT_EXIT NAME BASE HEAD
local got=0
if ! (cd "$repo" && bash "$changed" "$3" "$4") >"$changes"; then
echo "FAIL $2: listing the changes failed"
fail=1
return
fi
bash "$check" "$allow" <"$changes" >/dev/null || got=$?
if [[ $got != "$1" ]]; then
echo "FAIL $2: exit $got, want $1"
fail=1
fi
}
g init -q
blob=$(printf x | g hash-object -w --stdin)
g read-tree --empty
root=$(g commit-tree "$(g write-tree)" -m root)
main=$(commit "$root" core/storage/old.go docs/x.md cmd/foo/guard_test.go)
unicode=$(commit "$main" $'core/storage/\xc3\xa9_test.go')
oddnames=$(commit "$main" $'docs/tab\there.md' $'docs/new\nline.md' $'docs/\xc3\xa9.md')
moved=$(commit "$main" -core/storage/old.go docs/moved.md)
parent=$(commit "$main" core/storage/parent.go)
stacked=$(commit "$parent" docs/child.md)
later=$(commit "$main" core/storage/later.go)
testadd=$(commit "$main" cmd/foo/extra_test.go)
testdel=$(commit "$main" -cmd/foo/guard_test.go)
testmove=$(commit "$main" -cmd/foo/guard_test.go cmd/foo/renamed_test.go)
n=$( (cd "$repo" && bash "$changed" "$main" "$oddnames") | tr -cd '\000' | wc -c | tr -d ' ')
[[ $n == 6 ]] || { echo "FAIL fixture: $n NULs for 3 odd names, want 6"; fail=1; }
if ! (cd "$repo" && git diff --name-only "$main...$unicode") | grep -q '^"'; then
echo "FAIL fixture: expected git to quote the unicode name in its default output"
fail=1
fi
expect_diff 1 "git: unicode test file in storage" "$main" "$unicode"
expect_diff 0 "git: tab, newline and unicode names in docs" "$main" "$oddnames"
expect_diff 1 "git: moved out of storage into docs" "$main" "$moved"
expect_diff 0 "git: stacked PR against its parent" "$parent" "$stacked"
expect_diff 1 "git: the same PR retargeted to main" "$main" "$stacked"
expect_diff 0 "git: the base moved on with denied changes; the PR did not" "$later" "$oddnames"
expect_diff 0 "git: a test added" "$main" "$testadd"
expect_diff 1 "git: a test deleted" "$main" "$testdel"
expect_diff 1 "git: a test moved" "$main" "$testmove"
if (cd "$repo" && bash "$changed" 0000000000000000000000000000000000000001 "$main") >/dev/null 2>&1; then
echo "FAIL git: listing against an unknown base succeeded"
fail=1
fi
# The workflow reruns on every change that can change the verdict, including
# a retarget (edited).
types=$(sed -n 's/^ *types: *\[\(.*\)\].*/\1/p' "$workflow" | tr -d ' ')
for want in opened synchronize reopened labeled unlabeled edited; do
[[ ",$types," == *",$want,"* ]] || { echo "FAIL workflow does not run on $want"; fail=1; }
done
if ((fail)); then exit 1; fi
echo "post-merge-review check: self-test ok"
@@ -1,77 +0,0 @@
#!/usr/bin/env bash
# Usage: post-merge-review-check.sh ALLOW_FILE < changes
#
# changes are NUL-separated STATUS, PATH pairs (post-merge-review-changed.sh).
# A path passes only if it matches an allow pattern and no "!" pattern, and
# a test file may be added or modified but not deleted (a move deletes its
# old name). Prints every change that does not pass and exits 1 if there is
# one; exits 0 if all pass, 2 on a usage error, a malformed change or a
# missing or empty allow list.
set -euo pipefail
allow_file=${1:?usage: post-merge-review-check.sh ALLOW_FILE < changes}
if [[ ! -f $allow_file ]]; then
echo "post-merge-review: allow list $allow_file missing" >&2
exit 2
fi
allow=()
deny=()
# A last line without a newline is read too: dropping it could drop a "!".
while IFS= read -r line || [[ -n $line ]]; do
line=${line%%#*}
line=${line%"${line##*[![:space:]]}"}
line=${line#"${line%%[![:space:]]*}"}
[[ -n $line ]] || continue
if [[ $line == '!'* ]]; then
deny+=("${line#!}")
else
allow+=("$line")
fi
done <"$allow_file"
if ((${#allow[@]} == 0)); then
echo "post-merge-review: empty allow list $allow_file" >&2
exit 2
fi
denied=0
checked=0
malformed() {
echo "post-merge-review: malformed change list: $1" >&2
exit 2
}
while :; do
# Every field ends in NUL: a field cut off at the end is malformed, not
# skipped, and only the statuses git diff --no-renames writes are known.
if ! IFS= read -r -d '' status; then
[[ -z $status ]] || malformed "unterminated status ${status@Q}"
break
fi
[[ $status == [ADMT] ]] || malformed "unknown status ${status@Q}"
IFS= read -r -d '' path || malformed "status $status without a terminated path"
[[ -n $path ]] || malformed "status $status with an empty path"
checked=$((checked + 1))
why="not on the allow list"
for p in "${allow[@]}"; do
# Unquoted on the right: a glob, where * also matches /.
if [[ $path == $p ]]; then
why=""
break
fi
done
for p in ${deny[@]+"${deny[@]}"}; do
if [[ $path == $p ]]; then
why="matches !$p"
break
fi
done
# A labelled PR may not delete a test (or turn it into something else).
if [[ -z $why && $path == *_test.go && $status != [AM] ]]; then
why="test file status $status: only adding or modifying a test is allowed"
fi
if [[ -n $why ]]; then
printf 'DENY %s %q (%s)\n' "$status" "$path" "$why"
denied=1
fi
done
echo "post-merge-review: $checked changed path(s) checked against ${#allow[@]} allow and ${#deny[@]} deny pattern(s)"
exit "$denied"
-51
View File
@@ -1,51 +0,0 @@
#!/usr/bin/env bash
# Self-test of public-text-check.sh in a throwaway repository.
set -euo pipefail
here=$(cd "$(dirname "$0")" && pwd)
t=$(mktemp -d); trap 'rm -rf "$t"' EXIT
cd "$t"; git init -q .; git config user.email t@example.invalid; git config user.name t
echo base > a.txt; git add a.txt; git commit -q -m "base"
mb=$(git rev-parse HEAD)
: > title; : > body
run() { bash "$here/public-text-check.sh" "$@" >out 2>&1; }
expect() { # expect RC NAME
local want=$1 name=$2 rc=0
shift 2
run "$@" || rc=$?
[ "$rc" = "$want" ] || { echo "public-text-check-test: $name: exit $rc, want $want"; cat out; exit 1; }
}
echo "plain line" >> a.txt; git commit -q -am "add a plain line"
expect 0 "clean change" "$mb" HEAD title body
seat="clau""de06"; path="V:/sha""re/x"; nas="share/rd""ma/y"
echo "// asked by $seat" >> a.txt; git commit -q -am "comment"
expect 1 "seat name in an added line" "$mb" HEAD title body
grep -q "a.txt:3" out || { echo "public-text-check-test: hit does not name file and line"; cat out; exit 1; }
git reset -q --hard HEAD~1
echo "ok" >> a.txt; git commit -q -am "review by $seat"
expect 1 "seat name in a commit subject" "$mb" HEAD title body
git reset -q --hard HEAD~1
echo "see $path" > title; expect 1 "share path in the title" "$mb" HEAD title body; : > title
echo "results under $nas" > body; expect 1 "share path in the description" "$mb" HEAD title body; : > body
echo "an old line with $seat" >> a.txt; git commit -q -am "old"; mb2=$(git rev-parse HEAD)
echo "new clean line" >> a.txt; git commit -q -am "new"
expect 0 "an existing line is not this change's" "$mb2" HEAD title body
# A file line that begins with "++ " shows in the diff as "+++ ...": an added line, not a header.
printf '%s
' "++ $seat" >> a.txt; git commit -q -am "plus line"
expect 1 "an added line that looks like a diff header" "$mb2" HEAD title body
git reset -q --hard HEAD~1
bs=$(printf '\')
printf '%s
' "${bs}${bs}nas${bs}sha""re${bs}rd""ma${bs}z" > title
expect 1 "backslash form of the share path in the title" "$mb2" HEAD title body; : > title
expect 2 "a missing title file is an error, not clean" "$mb2" HEAD no-such-title body
expect 2 "a missing description file is an error, not clean" "$mb2" HEAD title no-such-body
expect 2 "an unknown commit is an error, not clean" 0000000000000000000000000000000000000000 HEAD title body
# A grep that fails (exit 2) is an error: the check must refuse and never print "clean".
mkdir -p fakebin; printf '#!/bin/sh
exit 2
' > fakebin/grep; chmod +x fakebin/grep
rc=0; PATH="$PWD/fakebin:$PATH" bash "$here/public-text-check.sh" "$mb2" HEAD title body >out 2>&1 || rc=$?
[ "$rc" = 2 ] || { echo "public-text-check-test: failing grep: exit $rc, want 2"; cat out; exit 1; }
if PATH=/usr/bin:/bin grep -q "clean" out; then echo "public-text-check-test: failing grep printed clean"; cat out; exit 1; fi
echo "public-text-check-test: ok"
-49
View File
@@ -1,49 +0,0 @@
#!/usr/bin/env bash
# Refuses internal names in what a pull request makes public: the lines it
# adds, its commit messages, its title and its description. This repository is
# public; internal seat names and internal file-share paths do not belong in it.
#
# Usage: public-text-check.sh MERGE_BASE HEAD TITLE_FILE BODY_FILE
# Exit 0: clean. Exit 1: at least one hit (each printed). Exit 2: usage.
#
# The patterns live only here and in this check's own test; both files are
# excluded from the scan of added lines.
set -euo pipefail
[ "$#" -eq 4 ] || { echo "usage: public-text-check.sh MERGE_BASE HEAD TITLE_FILE BODY_FILE" >&2; exit 2; }
mb=$1; head=$2; title=$3; body=$4
for f in "$title" "$body"; do
[ -f "$f" ] && [ -r "$f" ] || { echo "public-text: cannot read $f" >&2; exit 2; }
done
git rev-parse -q --verify "$mb^{commit}" >/dev/null && git rev-parse -q --verify "$head^{commit}" >/dev/null ||
{ echo "public-text: unknown commit $mb or $head" >&2; exit 2; }
# match: a grep error fails the check instead of reading as "no hit".
match() { local rc=0; grep -E -i -- "$pat" "$@" || rc=$?; [ "$rc" -le 1 ] || { echo "public-text: grep failed ($rc)" >&2; exit 2; }; }
pat='(claude|codex)0[0-9]|share[/\]rdma|V:[/\]share|diskstation'
out=$(mktemp); trap 'rm -f "$out"' EXIT
report() { # report WHERE < matching lines
local where=$1 line
while IFS= read -r line; do
printf 'public-text: %s: %s
' "$where" "${line:0:160}" >>"$out"
done
}
# Added lines of the diff, with file and line number.
git diff --no-color --no-renames -U0 "$mb" "$head" -- . \
':(exclude).github/scripts/public-text-check.sh' ':(exclude).github/scripts/public-text-check-test.sh' |
awk '
/^diff --git / { hdr = 1; next }
hdr && /^\+\+\+ / { f = substr($0, 7); next }
/^@@ / { hdr = 0; split($3, a, ","); n = substr(a[1], 2) + 0; next }
!hdr && /^\+/ { print f ":" n ": " substr($0, 2); n++ }
' | match | report "added line"
# Commit messages (subjects and bodies) of the pull request.
git log --format='%h %s%n%b' "$mb..$head" | match | report "commit message"
match "$title" | report "title"
match "$body" | report "description"
hits=$(wc -l <"$out" | tr -d ' ')
if [ "$hits" -gt 0 ]; then
cat "$out"
echo "public-text: $hits hit(s). Say what the code or test does instead of who asked for it; keep internal paths out." >&2
exit 1
fi
echo "public-text: clean"
-75
View File
@@ -1,75 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
here=$(cd "$(dirname "$0")" && pwd)
root=$(mktemp -d)
trap 'rm -rf "$root"' EXIT
mkdir -p "$root/bin"
cat >"$root/bin/go" <<'EOF'
#!/usr/bin/env bash
set -e
test "$1" = test && test "$2" = -json || exit 99
printf '%s\n' '{"Time":"2026-12-02T00:00:01Z","Action":"run","Test":"TestX"}'
printf '%s\n' '{"Time":"2026-12-02T00:00:02Z","Action":"output","Test":"TestX","Output":"fixture output\n"}'
printf '%s\n' '{"Time":"2026-12-02T00:00:02Z","Action":"fail","Test":"TestX","Elapsed":1}'
if [ "${FAKE_GO_LARGE:-0}" = 1 ]; then
for ((i=0; i<10000; i++)); do printf '%s\n' '{"Action":"output","Output":"draining after recorder failure\n"}'; done
fi
echo 'fixture stderr' >&2
if [ "${FAKE_GO_LARGE_STDERR:-0}" = 1 ]; then
for ((i=0; i<10000; i++)); do echo 'stderr draining after recorder failure' >&2; done
fi
exit "${FAKE_GO_EXIT:-0}"
EOF
chmod +x "$root/bin/go"
export PATH="$root/bin:$PATH"
code=0
FAKE_GO_EXIT=7 bash "$here/record-go-test.sh" "$root/go-test.json" -run TestX >"$root/console" 2>"$root/stderr" || code=$?
test "$code" = 7
grep -q 'fixture output' "$root/console"
grep -q 'fixture stderr' "$root/go-test.stderr"
"${PYTHON:-python3}" -c 'import json,sys; events=[json.loads(s) for s in open(sys.argv[1])]; assert len(events)==3; assert events[-1]["Elapsed"]==1; assert events[-1]["Time"]=="2026-12-02T00:00:02Z"' "$root/go-test.json"
FAKE_GO_EXIT=0 bash "$here/record-go-test.sh" "$root/go-test.json" -run TestX >"$root/console" 2>"$root/stderr"
test "$(wc -l <"$root/go-test.json")" = 6
# The evidence destination cannot be opened (a file where its parent belongs).
# The original Go success/failure must still be the command's answer.
echo occupied >"$root/not-a-directory"
code=0
FAKE_GO_EXIT=0 bash "$here/record-go-test.sh" "$root/not-a-directory/go-test.json" >"$root/console" 2>"$root/stderr" || code=$?
test "$code" = 0
grep -q 'fixture output' "$root/console"
code=0
FAKE_GO_EXIT=7 bash "$here/record-go-test.sh" "$root/not-a-directory/go-test.json" >"$root/console" 2>"$root/stderr" || code=$?
test "$code" = 7
if [ "$(uname -s)" = Linux ] && [ -c /dev/full ]; then
ln -s /dev/full "$root/full.json"
FAKE_GO_LARGE=1 FAKE_GO_EXIT=0 bash "$here/record-go-test.sh" "$root/full.json" >"$root/console" 2>"$root/stderr"
grep -q 'draining after recorder failure' "$root/console"
grep -q 'test evidence unavailable' "$root/stderr"
fi
# The recorder itself dies after its first bytes (a crash, an OOM kill): the
# rest of a large stream still drains and Go's own status is the answer.
cat >"$root/bin/dead-recorder" <<'EOF2'
#!/usr/bin/env bash
head -c 100 >/dev/null
exit 3
EOF2
chmod +x "$root/bin/dead-recorder"
for want in 0 7; do
code=0
PYTHON="$root/bin/dead-recorder" FAKE_GO_LARGE=1 FAKE_GO_EXIT=$want bash "$here/record-go-test.sh" "$root/dead.json" >"$root/console" 2>"$root/stderr" || code=$?
test "$code" = "$want"
grep -q 'draining after recorder failure' "$root/console"
grep -q 'the recorder exited' "$root/stderr"
# The stderr reader dies with a large stderr still to come.
code=0
PYTHON="$root/bin/dead-recorder" FAKE_GO_LARGE_STDERR=1 FAKE_GO_EXIT=$want bash "$here/record-go-test.sh" "$root/dead.json" >"$root/console" 2>"$root/stderr" || code=$?
test "$code" = "$want"
grep -q 'stderr draining after recorder failure' "$root/stderr"
# The recorder cannot start at all (no such interpreter).
code=0
PYTHON="$root/bin/no-such-python" FAKE_GO_LARGE=1 FAKE_GO_LARGE_STDERR=1 FAKE_GO_EXIT=$want bash "$here/record-go-test.sh" "$root/dead.json" >"$root/console" 2>"$root/stderr" || code=$?
test "$code" = "$want"
grep -q 'draining after recorder failure' "$root/console"
grep -q 'stderr draining after recorder failure' "$root/stderr"
done
echo 'record-go-test: output, timestamp, elapsed, append, dead-recorder and exit-status controls PASS'
-22
View File
@@ -1,22 +0,0 @@
#!/usr/bin/env bash
# Keep timestamped Go events, while preserving the existing human output and
# nonzero pipeline status. One caller at a time appends to a job's event file.
set -euo pipefail
out=$1
shift
mkdir -p "$(dirname "$out")" || true
capture="$(dirname "$0")/go-test-output.py"
# A recorder that dies (or cannot start) hands the rest of its stream to cat,
# so Go never writes into a closed pipe.
exec 3> >({ "${PYTHON:-python3}" -u "$capture" "${out%.json}.stderr" --raw || cat; } >&2)
stderr_pid=$!
# Only Go judges the test. The readers keep draining after evidence IO errors,
# so a disk-full recorder cannot turn Go's PASS into a pipeline/SIGPIPE failure.
set +e
go test -json "$@" 2>&3 |
{ "${PYTHON:-python3}" -u "$capture" "$out" || { echo "test evidence unavailable: the recorder exited" >&2; cat; }; }
status=${PIPESTATUS[0]}
set -e
exec 3>&-
wait "$stderr_pid" || true
exit "$status"
-45
View File
@@ -1,45 +0,0 @@
#!/usr/bin/env bash
# Tests require-nvme.sh with df and lsblk replaced by stubs on PATH.
set -euo pipefail
here=$(cd "$(dirname "$0")" && pwd)
t=$(mktemp -d)
trap 'rm -rf "$t"' EXIT
mkdir -p "$t/bin" "$t/nvme" "$t/sata" "$t/mem" "$t/raid" "$t/share" "$t/half"
# df --output=source,fstype DIR: the stub answers by the directory's name.
cat >"$t/bin/df" <<STUB
#!/usr/bin/env bash
printf 'Filesystem Type\n'
case "\$2" in
$t/nvme*) echo '/dev/nvme0n1p1 ext4' ;;
$t/mem*) echo 'shm tmpfs' ;;
$t/raid*) echo '/dev/md0 ext4' ;;
$t/share*) echo '//nas/work cifs' ;;
$t/half*) echo '/dev/nvme1n1p1 ext4' ;;
*) echo '/dev/sda2 ext4' ;;
esac
STUB
# lsblk -nrso TYPE,TRAN SOURCE: the source and the devices under it.
cat >"$t/bin/lsblk" <<'STUB'
#!/usr/bin/env bash
case "$3" in
/dev/nvme0n1p1) printf 'part \ndisk nvme\n' ;;
/dev/sda2) printf 'part \ndisk sata\n' ;;
/dev/md0) printf 'raid1 \npart \ndisk nvme\npart \ndisk sata\n' ;;
/dev/nvme1n1p1) printf 'part \ndisk nvme\n'; echo "lsblk: read error" >&2; exit 32 ;;
*) echo "lsblk: $3: not a block device" >&2; exit 32 ;;
esac
STUB
chmod +x "$t/bin/df" "$t/bin/lsblk"
run() { PATH="$t/bin:$PATH" RUNNER_NAME=r1 bash "$here/require-nvme.sh" "$@" >"$t/out" 2>&1; }
fail() { echo "FAIL: $*"; cat "$t/out"; exit 1; }
run "$t/nvme" "$t/mem" "" || fail "nvme + tmpfs (any source name) + empty arg must pass"
run "$t/nvme/not/made/yet" || fail "a missing dir is judged by its nearest existing parent"
! run "$t/nvme" "$t/sata" || fail "a SATA dir must fail"
grep -q "runner r1" "$t/out" || fail "the failure must name the runner"
grep -q "FAIL $t/sata" "$t/out" || fail "the failure must name the directory"
! run "$t/raid" || fail "an array with a SATA member must fail"
! run "$t/share" || fail "a network share must fail"
grep -q "not a block device" "$t/out" || fail "a network share must say why"
! run "$t/half" || fail "an lsblk error after partial NVMe output must fail"
echo "require-nvme tests: ok"
-36
View File
@@ -1,36 +0,0 @@
#!/usr/bin/env bash
# Fails a self-hosted job whose workspace, temp or Go cache directory is not
# on an NVMe disk. The process-level tests write and fsync real files; on a
# box whose system disk is SATA, a default runner install puts _work there and
# the tests time out under the disk load instead of failing on a real bug.
# A tmpfs directory is accepted (memory, not a slow disk).
# Usage: require-nvme.sh DIR...
set -euo pipefail
bad=0
for p in "$@"; do
[ -n "$p" ] || continue
d=$p
while [ ! -e "$d" ]; do d=$(dirname "$d"); done
read -r src fstype < <(df --output=source,fstype "$d" | tail -n 1)
if [ "$fstype" = tmpfs ]; then
echo "ok $p: $src (tmpfs)"
continue
fi
# Every disk under the source (all members of an array) must be NVMe; an
# lsblk error voids whatever it printed.
disks=
if tree=$(lsblk -nrso TYPE,TRAN "$src" 2>/dev/null); then
disks=$(printf '%s\n' "$tree" |
awk '$1 == "disk" { print ($2 == "" ? "unknown" : $2) }' | sort -u | tr '\n' ' ')
fi
if [ "$disks" = "nvme " ]; then
echo "ok $p: $src (nvme)"
else
echo "FAIL $p: $src (disk: ${disks:-not a block device})"
bad=1
fi
done
if [ "$bad" -ne 0 ]; then
echo "runner ${RUNNER_NAME:-?}: work, temp and Go cache directories must be on NVMe; move them before this runner takes jobs" >&2
exit 1
fi
@@ -1,128 +0,0 @@
"""Self-test of required-tests-check.py: event streams against the exit code
they must give. A gate that cannot fail is the defect this check exists to
prevent, so every way a named test can fail to pass is here."""
import json
import os
import subprocess
import sys
import tempfile
HERE = os.path.dirname(os.path.abspath(__file__))
CHECK = os.path.join(HERE, 'required-tests-check.py')
def ev(action, test=None, elapsed=None):
e = {'Action': action, 'Package': 'example/cmd/blockvolume'}
if test:
e['Test'] = test
if elapsed is not None:
e['Elapsed'] = elapsed
return json.dumps(e)
def ran(test, end='pass', secs=1.5):
return [ev('run', test), ev('output', test), ev(end, test, secs)]
def run(names, *streams, status=None):
with tempfile.TemporaryDirectory() as d:
nf = os.path.join(d, 'names')
with open(nf, 'w', encoding='utf-8') as f:
f.write(names)
files = []
for i, lines in enumerate(streams):
p = os.path.join(d, 'events%d' % i)
with open(p, 'w', encoding='utf-8') as f:
f.write('\n'.join(lines) + '\n')
files.append(p)
extra = []
if status is not None:
sf = os.path.join(d, 'status')
with open(sf, 'w', encoding='utf-8') as f:
f.write(status)
extra = ['--status', sf]
r = subprocess.run([sys.executable, '-I', CHECK] + extra + [nf] + files, capture_output=True, text=True)
return r.returncode, r.stdout + r.stderr
NG = 'TestA\nTestB # nongating=#920\n'
CASES = [
# (name, want exit, names file, streams)
('a non-gating test that passed', 0, NG, [ran('TestA') + ran('TestB')]),
('a non-gating test that failed does not fail the run', 0, NG, [ran('TestA') + ran('TestB', 'fail')]),
('a non-gating failure, then its process failed: still its own', 0, NG,
[ran('TestA'), ran('TestB', 'fail') + [ev('fail')]]),
('a gating test still fails the run beside a non-gating one', 1, NG, [ran('TestA', 'fail') + ran('TestB')]),
('a process failure after a gating test still fails the run', 1, NG, [ran('TestA') + [ev('fail')], ran('TestB')]),
('a non-gating test that never ran fails (not run is not reported)', 1, NG, [ran('TestA')]),
('nongating without an issue is refused', 2, 'TestA\nTestB # nongating\n', [ran('TestA') + ran('TestB')]),
('every named test passed', 0, 'TestA\nTestB # a comment\n', [ran('TestA') + ran('TestB')]),
('passes spread over two streams', 0, 'TestA\nTestB\n', [ran('TestA'), ran('TestB')]),
('an unnamed test may fail', 0, 'TestA\n', [ran('TestA') + ran('TestOther', 'fail')]),
('a passing subtest does not stand for a skipped parent', 1, 'TestA\n',
[[ev('run', 'TestA'), ev('pass', 'TestA/sub', 1), ev('skip', 'TestA', 0)]]),
('a skip is a failure', 1, 'TestA\nTestB\n', [ran('TestA') + ran('TestB', 'skip', 0)]),
('a failed test', 1, 'TestA\n', [ran('TestA', 'fail')]),
('a test that never ran', 1, 'TestA\nTestB\n', [ran('TestA')]),
('a test that started and never ended (killed by the timeout)', 1, 'TestA\n', [[ev('run', 'TestA'), ev('output', 'TestA')]]),
('passed in one stream, failed in another', 1, 'TestA\n', [ran('TestA'), ran('TestA', 'fail')]),
('no events at all (the build failed)', 1, 'TestA\n', [['# example/cmd/blockvolume', 'build failed']]),
('a package-level failure after every named test passed', 1, 'TestA\n', [ran('TestA') + [ev('fail', None, 3)]]),
('a name listed twice', 2, 'TestA\nTestA\n', [ran('TestA')]),
('a subtest name in the list', 2, 'TestA/sub\n', [ran('TestA')]),
('an empty names file', 2, '# nothing\n', [ran('TestA')]),
]
def main():
fail = 0
for name, want, names, streams in CASES:
got, out = run(names, *streams)
if got != want:
print('FAIL %s: exit %d, want %d\n%s' % (name, got, want, out))
fail = 1
STATUS = [
('PASS events and every process exited 0', 0, 'TestA 0\nTestB 0\n'),
('PASS, then the process exited 1', 1, 'TestA 0\nTestB 1\n'),
('PASS, then the process was killed by the timeout', 1, 'TestA 0\nTestB 124\n'),
('a named test with no exit status', 1, 'TestA 0\n'),
('a named test ran twice', 1, 'TestA 0\nTestB 0\nTestB 0\n'),
('a malformed status line', 2, 'TestA 0\nTestB\n'),
]
for name, want, status in STATUS:
got, out = run('TestA\nTestB\n', ran('TestA') + ran('TestB'), status=status)
if got != want:
print('FAIL %s: exit %d, want %d\n%s' % (name, got, want, out))
fail = 1
got, out = run('TestA\n', [ev('run', 'TestA'), json.dumps({'Action': 'output', 'Test': 'TestA', 'Output': ' x_test.go:7: the reason\n'})] + [json.dumps({'Action': 'output', 'Test': 'TestA', 'Output': ' h_test.go:578: blockvolume-r%d log:\n' % i}) for i in range(20)] + [json.dumps({'Action': 'output', 'Test': 'TestA', 'Output': ' w_test.go:128: ---- master log tail ----\n'})] + [json.dumps({'Action': 'output', 'Test': 'TestA', 'Output': ' I1126 harness log line %d\n' % i}) for i in range(60)] + [ev('fail', 'TestA', 1)])
if got != 1 or 'x_test.go:7: the reason' not in out:
print('FAIL a failed test''s output is shown: %s' % out)
fail = 1
# A message whose reason is on its continuation lines (a holder's log
# tail after "its log ends:"), followed by a harness dump: the message's
# last continuation lines are shown, the dump is not.
o = lambda s: json.dumps({'Action': 'output', 'Test': 'TestA', 'Output': s + '\n'})
got, out = run('TestA\n', [ev('run', 'TestA'),
o(' f1_test.go:178: blockvolume-v5r2 exited (exit status 1) before logging "adopted"; its log ends:')]
+ [o(' holder line %d' % i) for i in range(40)]
+ [o(' holder: fatal: the reason it exited')]
+ [o(' w_test.go:128: ---- master log tail ----')]
+ [o(' I1201 harness log line %d' % i) for i in range(60)] + [ev('fail', 'TestA', 1)])
if got != 1 or 'holder: fatal: the reason it exited' not in out or 'holder line 39' not in out:
print('FAIL a failed message\'s continuation lines are shown: %s' % out)
fail = 1
if 'holder line 0\n' in out or 'harness log line 0\n' in out:
print('FAIL continuation lines are bounded and a dump\'s are not kept: %s' % out)
fail = 1
got, out = run('TestA\n', ran('TestA', secs=2.25))
if got != 0 or '2.2s' not in out and '2.3s' not in out:
print('FAIL the elapsed time is reported: %s' % out)
fail = 1
if not fail:
print('required-tests-check: %d cases ok' % (len(CASES) + len(STATUS) + 3))
return fail
if __name__ == '__main__':
sys.exit(main())
-214
View File
@@ -1,214 +0,0 @@
"""Every named test must have run and passed.
Usage: required-tests-check.py [--status STATUS_FILE] NAMES_FILE EVENTS_FILE...
NAMES_FILE holds one top-level test name per line (# starts a comment). A
name whose comment says `nongating=#N` (an open issue) is non-gating: it runs
and is reported like every other, but its failure does not fail the run; its
line says NON-GATING and names the issue, and a failure-process exit after it
is its own, not the binary's. A non-gating test that never ran still fails:
a test that is not run is not reported.
EVENTS_FILE is `go test -json` (or `go tool test2json`) output. A named test
that skipped, failed, never started or never ended is a failure: a test that
cannot start proves nothing, so it is not allowed to read as a pass. A name
listed twice, or a test that passed in one stream and failed in another, is a
failure too. A package-level failure event fails the run.
STATUS_FILE (run-named-tests.sh) holds one line per named test, NAME and the
exit status of the process that ran it. With it, a named test passes only if it
also has exactly one line and that status is 0: a test that reports PASS and
then fails, panics or hangs on its way out is not a pass. Prints one line per named test with its outcome and elapsed
seconds, then the total.
For every named test that did not pass, its own reported lines (the test's
file:line messages with the last lines of each one's continuation, not the
harness's log dumps) and its last lines follow the table, so a run's log
carries its own reasons.
Exit 0: every named test passed. 1: at least one did not. 2: usage or an
unreadable input.
"""
import json
import re
import sys
OWN = 12 # a failed test's own file:line messages shown (the last ones)
TAIL = 5 # and its last output lines
OWN_LINE = re.compile(r'^ [^ \t]+\.go:\d+: ') # the test's own t.Log/t.Error lines
# Not reasons: the harness's cleanup headers ("<process> log:", "---- <x> log
# tail ----") and the echo of a command that succeeded ("...: exit 0").
NOISE = re.compile(r' log:\s*$|---- .* ----\s*$|: exit 0\s*$')
CONT = 20 # the last continuation lines shown of each own message
CONT_LINE = re.compile(r'^ ') # a message's next line, as go test indents it
def own_messages(text):
"""The test's own messages, each its file:line line and the last CONT of
the continuation lines after it (a reason, such as a process's log tail,
is often on those). A harness header's lines are not kept, nor its dump."""
msgs, cur = [], None
for line in text:
if OWN_LINE.match(line):
cur = None
if not NOISE.search(line):
cur = [line, []]
msgs.append(cur)
elif cur is not None and CONT_LINE.match(line):
cur[1].append(line)
else:
cur = None
return [[head] + cont[-CONT:] for head, cont in msgs]
NONGATING = re.compile(r'\bnongating=(#\d+)')
def names_of(path):
"""The named tests, in order, and the non-gating ones with their issue."""
names, seen, nongating = [], set(), {}
with open(path, encoding='utf-8') as f:
for n, raw in enumerate(f, 1):
line, _, comment = raw.partition('#')
line = line.strip()
if not line:
continue
m = NONGATING.search('#' + comment)
if m:
nongating[line] = m.group(1)
elif 'nongating' in comment:
raise ValueError('%s:%d: %r: nongating needs an issue, nongating=#N' % (path, n, raw.strip()))
if not line.startswith('Test') or '/' in line or ' ' in line:
raise ValueError('%s:%d: %r is not a top-level test name' % (path, n, line))
if line in seen:
raise ValueError('%s:%d: %s is listed twice' % (path, n, line))
seen.add(line)
names.append(line)
if not names:
raise ValueError('%s: no test names' % path)
return names, nongating
def statuses_of(path):
"""Test name -> list of exit statuses."""
out = {}
with open(path, encoding='utf-8') as f:
for n, raw in enumerate(f, 1):
parts = raw.split()
if not parts:
continue
if len(parts) != 2 or not parts[1].lstrip('-').isdigit():
raise ValueError('%s:%d: %r is not NAME EXIT_STATUS' % (path, n, raw.strip()))
out.setdefault(parts[0], []).append(int(parts[1]))
return out
def outcomes(paths):
"""Test name -> list of (action, elapsed) for its terminal events, the
names that started (action run), the package-level failure events (each
with the test last started in its stream before it, or None), and each
test's output."""
ends, started, pkg_fail, output = {}, set(), [], {}
for path in paths:
last = None
with open(path, encoding='utf-8', errors='replace') as f:
for raw in f:
raw = raw.strip()
if not raw.startswith('{'):
continue # build output or a panic line between events
try:
ev = json.loads(raw)
except ValueError:
continue
test = ev.get('Test')
if not test:
if ev.get('Action') == 'fail':
pkg_fail.append(last) # the binary failed outside any test (or after one)
continue # other package events; a subtest's name never matches a top-level one
action = ev.get('Action')
if action == 'output':
output.setdefault(test.split('/')[0], []).append(ev.get('Output', ''))
continue
if action == 'run':
started.add(test)
if '/' not in test:
last = test
elif action in ('pass', 'fail', 'skip'):
ends.setdefault(test, []).append((action, ev.get('Elapsed')))
return ends, started, pkg_fail, output
def main(argv):
args = argv[1:]
status_file = None
if args[:1] == ['--status']:
if len(args) < 2:
print(__doc__.strip().splitlines()[2], file=sys.stderr)
return 2
status_file, args = args[1], args[2:]
if len(args) < 2:
print(__doc__.strip().splitlines()[2], file=sys.stderr)
return 2
try:
names, nongating = names_of(args[0])
ends, started, pkg_fail, output = outcomes(args[1:])
statuses = statuses_of(status_file) if status_file else None
except (OSError, ValueError) as e:
print('required-tests: %s' % e, file=sys.stderr)
return 2
# A package-level failure right after a non-gating test is that test's
# (each named test runs in its own process); any other fails the run.
pkg_own = {}
for after in pkg_fail:
if after in nongating:
pkg_own[after] = pkg_own.get(after, 0) + 1
pkg_fail = [a for a in pkg_fail if a not in nongating]
bad, total, failed, ng_failed = 0, 0.0, [], 0
for name in names:
got = ends.get(name, [])
actions = {a for a, _ in got}
secs = sum(e for _, e in got if isinstance(e, (int, float)))
total += secs
rcs = statuses.get(name, []) if statuses is not None else [0]
if actions == {'pass'} and len(got) == 1 and rcs == [0] and not pkg_own.get(name):
print('PASS %-70s %7.1fs' % (name, secs))
continue
failed.append(name)
issue = nongating.get(name)
ran_at_all = bool(got) or name in started
if issue and ran_at_all:
ng_failed += 1
else:
bad += 1
if actions == {'pass'} and len(got) == 1:
why = ('NO EXIT STATUS' if not rcs else
'PASSED, THEN EXIT %s' % ','.join(str(r) for r in rcs))
elif not got:
why = 'STARTED, NEVER ENDED' if name in started else 'NEVER RAN'
elif len(got) > 1:
why = 'RAN %d TIMES (%s)' % (len(got), ', '.join(a for a, _ in got))
else:
why = got[0][0].upper()
if pkg_own.get(name):
why += ', THEN THE PROCESS FAILED'
if issue and ran_at_all:
print('%-8s %-70s %7.1fs' % ('FAIL', name, secs) + ' ' + why + ' NON-GATING (%s): reported, does not fail the run' % issue)
else:
print('%-8s %-70s %7.1fs' % ('FAIL', name, secs) + ' ' + why)
for name in failed:
text = ''.join(output.get(name, [])).splitlines()
own = own_messages(text)[-OWN:]
print('---- %s: its own messages (%d), then its last %d lines' % (name, len(own), min(TAIL, len(text))))
for line in [l for m in own for l in m] + [' ...'] + text[-TAIL:]:
print(' ' + line[:300])
if pkg_fail:
print('FAIL the test binary reported %d package-level failure(s)' % len(pkg_fail))
print('required-tests: %d named, %d not passed, %.1fs in named tests' % (len(names), bad, total))
if nongating:
print('required-tests: %d non-gating (%s), %d of them failed' % (len(nongating), ', '.join('%s %s' % (n, nongating[n]) for n in names if n in nongating), ng_failed))
return 1 if bad or pkg_fail else 0
if __name__ == '__main__':
sys.exit(main(sys.argv))
-49
View File
@@ -1,49 +0,0 @@
#!/usr/bin/env bash
# Self-test of run-named-tests.sh with the gate (required-tests-check.py
# --status), through a real shell and test2json, with fake test binaries:
# a test that reports PASS and then exits nonzero, or hangs until the
# timeout, must fail the gate; an honest pass must not. Needs go (test2json).
set -euo pipefail
here=$(cd "$(dirname "$0")" && pwd)
tmp=$(mktemp -d)
trap 'rm -rf "$tmp"' EXIT
fail=0
# fake NAME BEHAVIOUR: a test binary that prints a passing verbose run of
# whatever -test.run names, then behaves as told.
fake() {
local f=$tmp/$1
cat >"$f" <<EOF
#!/usr/bin/env bash
for a in "\$@"; do case "\$a" in -test.run=*) re=\${a#-test.run=} ;; esac; done
prev=""
for a in "\$@"; do [ "\$prev" = -test.run ] && re=\$a; prev=\$a; done
name=\${re#^}; name=\${name%\\\$}
echo "=== RUN \$name"
echo "--- PASS: \$name (0.01s)"
echo "PASS"
$2
EOF
chmod +x "$f"
echo "$f"
}
# expect WANT_EXIT NAME BINARY
expect() {
local want=$1 name=$2 bin=$3 got=0
printf 'TestA\nTestB\n' >"$tmp/names"
TEST_PKG=example/fake bash "$here/run-named-tests.sh" "$bin" "$tmp/names" "$tmp/events" "$tmp/status" 3s "$tmp" >/dev/null
"${PYTHON:-python3}" -I "$here/required-tests-check.py" --status "$tmp/status" "$tmp/names" "$tmp/events" >"$tmp/out" || got=$?
if [[ $got != "$want" ]]; then
echo "FAIL $name: exit $got, want $want"
cat "$tmp/out"
fail=1
fi
}
expect 0 "PASS and exit 0" "$(fake ok 'exit 0')"
expect 1 "PASS, then exit 1" "$(fake exit1 'exit 1')"
expect 1 "PASS, then a hang until the timeout" "$(fake hang 'sleep 30')"
if ((fail == 0)); then echo "run-named-tests: 3 cases ok"; fi
exit "$fail"
-30
View File
@@ -1,30 +0,0 @@
#!/usr/bin/env bash
# Runs each test named in NAMES_FILE in its own process of TEST_BINARY, in
# sequence, so a panic or a hang in one cannot hide the others. Each process
# is bounded by TIMEOUT (the test binary's own timeout, then killed). Every
# process's exit status is kept: a test that reports PASS and then fails or
# hangs on its way out is not a pass (required-tests-check.py --status).
#
# Usage: run-named-tests.sh TEST_BINARY NAMES_FILE EVENTS_OUT STATUS_OUT TIMEOUT [DIR]
# TEST_BINARY absolute path of a binary built with go test -c
# EVENTS_OUT go test -json events of every process, appended in order
# STATUS_OUT one line per named test: NAME EXIT_STATUS
# DIR the directory each process runs in (default .)
# TEST_PKG names the package in the events (default the blockvolume command).
# Exits 0 once every named test has run; the verdict is the checker's.
set -euo pipefail
[ "$#" -ge 5 ] || { echo "usage: run-named-tests.sh TEST_BINARY NAMES_FILE EVENTS_OUT STATUS_OUT TIMEOUT [DIR]" >&2; exit 2; }
bin=$1 names=$2 out=$3 status=$4 to=$5 dir=${6:-.}
case "$bin" in /*) ;; *) echo "run-named-tests: TEST_BINARY must be absolute" >&2; exit 2 ;; esac
pkg=${TEST_PKG:-github.com/seaweedfs/seaweed-block/cmd/blockvolume}
: >"$out"
: >"$status"
while read -r name; do
start=$(date +%s)
rc=0
(cd "$dir" && timeout -k 30 "$to" "$bin" -test.v=test2json -test.count=1 \
-test.timeout "$to" -test.run "^${name}\$" 2>&1) |
go tool test2json -t -p "$pkg" >>"$out" || rc=$?
echo "$name $rc" >>"$status"
echo "$name: exit $rc, $(($(date +%s) - start))s"
done < <(sed 's/#.*//' "$names" | tr -d ' \t' | grep .)
-111
View File
@@ -1,111 +0,0 @@
// Command sametokens reports whether two versions of a Go source file have the
// same tokens in the same order, ignoring comments that the compiler ignores.
//
// Usage: go run sametokens.go OLD NEW
//
// A missing file counts as empty. Directive comments are compared as tokens:
// //go:..., // +build, //line, /*line, //export; in a file that uses cgo
// (any "C" string literal, as in import "C"), every comment counts, since the
// preamble is code. Exit 0: same tokens; 1: different
// (the first difference is printed); 2: usage error or a file that does not scan.
package main
import (
"fmt"
"go/scanner"
"go/token"
"os"
"strings"
)
type tok struct {
t token.Token
lit string
}
func main() {
if len(os.Args) != 3 {
fmt.Fprintln(os.Stderr, "usage: sametokens OLD NEW")
os.Exit(2)
}
a, err := tokens(os.Args[1])
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(2)
}
b, err := tokens(os.Args[2])
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(2)
}
for i := 0; i < len(a) || i < len(b); i++ {
if i >= len(a) || i >= len(b) || a[i] != b[i] {
fmt.Printf("token %d differs: %v vs %v\n", i, at(a, i), at(b, i))
os.Exit(1)
}
}
}
func at(ts []tok, i int) string {
if i >= len(ts) {
return "end of file"
}
return fmt.Sprintf("%s %q", ts[i].t, ts[i].lit)
}
// tokens scans a file and keeps every token except comments the compiler
// ignores. An automatic semicolon is compared by kind only.
func tokens(path string) ([]tok, error) {
src, err := os.ReadFile(path)
if os.IsNotExist(err) {
return nil, nil
} else if err != nil {
return nil, err
}
fset := token.NewFileSet()
file := fset.AddFile(path, -1, len(src))
var s scanner.Scanner
var scanErr error
s.Init(file, src, func(pos token.Position, msg string) {
if scanErr == nil {
scanErr = fmt.Errorf("%s: %s", pos, msg)
}
}, scanner.ScanComments)
var all []tok
for {
_, t, lit := s.Scan()
if t == token.EOF {
break
}
if t == token.SEMICOLON {
lit = ""
}
all = append(all, tok{t, lit})
}
if scanErr != nil {
return nil, scanErr
}
cgo := false
for _, x := range all {
if x.t == token.STRING && x.lit == "\"C\"" {
cgo = true
}
}
var out []tok
for _, x := range all {
if x.t == token.COMMENT && !cgo && !directive(x.lit) {
continue
}
out = append(out, x)
}
return out, nil
}
func directive(c string) bool {
for _, p := range []string{"//go:", "// +build", "//+build", "//line ", "/*line ", "//export "} {
if strings.HasPrefix(c, p) {
return true
}
}
return false
}
-55
View File
@@ -1,55 +0,0 @@
"""Tests shard-named-tests.py: every name in exactly one shard, longest first
into the least-loaded shard, the same split on every run, unknown names
counted, and a duplicate or empty list refused."""
import importlib.util
import os
import subprocess
import sys
import tempfile
HERE = os.path.dirname(os.path.abspath(__file__))
SCRIPT = os.path.join(HERE, "shard-named-tests.py")
spec = importlib.util.spec_from_file_location("shard", SCRIPT)
shard = importlib.util.module_from_spec(spec)
spec.loader.exec_module(shard)
fail = 0
def check(name, ok):
global fail
print(("ok " if ok else "FAIL ") + name)
if not ok:
fail = 1
secs = {"A": 500, "B": 400, "C": 300, "D": 100, "E": 100}
parts, load = shard.shard(list(secs), secs, 2)
check("every name once", sorted(sum(parts, [])) == sorted(secs))
check("longest first, least loaded", parts == [["A", "D", "E"], ["B", "C"]] and load == [700, 700])
check("same split on every run", shard.shard(list(secs), secs, 2) == (parts, load))
parts, load = shard.shard(["A", "Z"], {"A": 10}, 2)
check("an unknown name counts as the default", load == [shard.DEFAULT, 10.0])
parts, _ = shard.shard(["A", "B"], {}, 4)
check("more shards than names leaves some empty", sum(len(p) for p in parts) == 2 and [] in parts)
with tempfile.TemporaryDirectory() as d:
names = os.path.join(d, "names.txt")
seconds = os.path.join(d, "seconds.txt")
with open(seconds, "w") as f:
f.write("# times\nTestA 30\nTestB 20\n")
with open(names, "w") as f:
f.write("# list\nTestA\nTestB # note\n\nTestC\n")
rc = subprocess.run([sys.executable, "-I", SCRIPT, names, seconds, "2", os.path.join(d, "out")], capture_output=True, text=True).returncode
got = sorted(open(os.path.join(d, "out", f)).read().split() for f in ("1.txt", "2.txt"))
check("the files hold every name once", rc == 0 and sorted(sum(got, [])) == ["TestA", "TestB", "TestC"])
with open(names, "w") as f:
f.write("TestA\nTestA\n")
rc = subprocess.run([sys.executable, "-I", SCRIPT, names, seconds, "2", os.path.join(d, "o2")], capture_output=True, text=True).returncode
check("a name listed twice is refused", rc == 2)
with open(names, "w") as f:
f.write("# nothing\n")
rc = subprocess.run([sys.executable, "-I", SCRIPT, names, seconds, "2", os.path.join(d, "o3")], capture_output=True, text=True).returncode
check("an empty list is refused", rc == 2)
sys.exit(fail)
-69
View File
@@ -1,69 +0,0 @@
"""Split the named process-level tests into N balanced shards.
Usage: shard-named-tests.py NAMES_FILE SECONDS_FILE N OUT_DIR
Writes OUT_DIR/1.txt .. OUT_DIR/N.txt, one test name per line. Every name in
NAMES_FILE (# starts a comment) lands in exactly one shard. SECONDS_FILE holds
"Name seconds" lines from an earlier run; a name missing there counts as
DEFAULT seconds. Longest first, each into the shard with the least time so
far (ties to the lowest shard), so the result is the same on every run.
Prints each shard's names count and its estimated seconds.
Exit 0, or 2 on a usage error, a duplicate name or an empty names list.
"""
import os
import sys
DEFAULT = 60.0
def names_of(path):
out = []
for line in open(path, encoding="utf-8"):
name = line.split("#", 1)[0].strip()
if name:
out.append(name)
return out
def seconds_of(path):
out = {}
for line in open(path, encoding="utf-8"):
fields = line.split("#", 1)[0].split()
if len(fields) == 2:
out[fields[0]] = float(fields[1])
return out
def shard(names, seconds, n):
load = [0.0] * n
shards = [[] for _ in range(n)]
for name in sorted(names, key=lambda x: (-seconds.get(x, DEFAULT), x)):
k = min(range(n), key=lambda i: (load[i], i))
shards[k].append(name)
load[k] += seconds.get(name, DEFAULT)
return shards, load
def main(argv):
if len(argv) != 5:
print(__doc__.strip().splitlines()[2], file=sys.stderr)
return 2
names = names_of(argv[1])
if not names or len(set(names)) != len(names):
print("shard-named-tests: empty names list or a name listed twice", file=sys.stderr)
return 2
n = int(argv[3])
if n < 1:
return 2
shards, load = shard(names, seconds_of(argv[2]), n)
os.makedirs(argv[4], exist_ok=True)
for i, part in enumerate(shards, 1):
with open(os.path.join(argv[4], "%d.txt" % i), "w", encoding="utf-8") as f:
f.write("".join(x + "\n" for x in part))
print("shard %d: %d tests, about %d s" % (i, len(part), load[i - 1]))
return 0
if __name__ == "__main__":
sys.exit(main(sys.argv))
-151
View File
@@ -1,151 +0,0 @@
#!/usr/bin/env bash
# Self-test of the spec-trace check: PR descriptions and change lists against
# the exit code they must give.
set -euo pipefail
here=$(cd "$(dirname "$0")" && pwd)
check=$here/spec-trace-check.sh
tmp=$(mktemp -d)
trap 'rm -rf "$tmp"' EXIT
fail=0
# expect WANT_EXIT NAME BODY [STATUS PATH]...
expect() {
local want=$1 name=$2 body=$3 got=0
shift 3
printf '%s' "$body" >"$tmp/body"
if (($#)); then printf '%s\0' "$@"; fi | bash "$check" "$tmp/body" >/dev/null || got=$?
if [[ $got != "$want" ]]; then
echo "FAIL $name: exit $got, want $want"
fail=1
fi
}
ok='Feature: O-SNAP-2
Machine/INV: IMPL M5.Quiesce>Copy / INV-MAINT-ONE-OWNER
Model: docs/spec/MaintenanceOwner.tla, exhausted
Red-first: 7f542dbc TestMaintenanceHeldPass failed on base'
simplest='Simplest: one owner per volume on the existing cut path; no new machine.'
expect 0 "all four lines, docs only" "$ok" M docs/a.md
expect 0 "FIX kind" "${ok/IMPL M5.Quiesce>Copy/FIX INV-GC-SKEW-001}"
expect 0 "CHANGE kind" "${ok/IMPL M5.Quiesce>Copy/CHANGE M5}"
expect 0 "core change with Simplest" "$ok
$simplest" M core/storage/gc.go
expect 0 "core test only needs no Simplest" "$ok" M core/storage/gc_test.go
expect 0 "CRLF body" "$(printf '%s\n' "$ok" | sed 's/$/\r/')"
expect 0 "CHANGE of two machines" "${ok/IMPL M5.Quiesce>Copy/CHANGE M4, M6}"
expect 0 "list markers and bold keys" "$(printf '%s\n' "$ok" | sed "s/^Feature:/- **Feature:**/; s/^Model:/* Model:/")"
expect 0 "Model NONE with a reason" "${ok/Model: docs\/spec\/MaintenanceOwner.tla, exhausted/Model: NONE: CI wiring only, no state}"
expect 1 "empty body" ""
expect 1 "missing Red-first" "$(printf '%s\n' "$ok" | grep -v Red-first)"
expect 1 "short NONE" "${ok/Model: docs\/spec\/MaintenanceOwner.tla, exhausted/Model: NONE: n/a}"
expect 1 "no kind" "${ok/IMPL M5.Quiesce>Copy/B,D,E}"
expect 1 "IMPL without transition" "${ok/IMPL M5.Quiesce>Copy/IMPL M5}"
expect 1 "NONE is not a kind" "${ok/IMPL M5.Quiesce>Copy \/ INV-MAINT-ONE-OWNER/NONE: tooling only, no machine}"
expect 1 "core file deleted without Simplest" "$ok" D core/storage/old.go
expect 1 "two kinds" "${ok/IMPL M5.Quiesce>Copy/IMPL M5.Quiesce>Copy FIX INV-MAINT-ONE-OWNER}"
expect 1 "second Machine/INV line with another kind" "$ok
Machine/INV: FIX INV-MAINT-ONE-OWNER"
expect 1 "second Machine/INV line in list and bold form" "$ok
- **Machine/INV:** CHANGE M5"
expect 1 "Simplest declared twice" "$ok
$simplest
$simplest" M core/storage/gc.go
expect 1 "kind token with a trailing junk" "${ok/IMPL M5.Quiesce>Copy/FIX INV-GC-SKEW-001x}"
expect 1 "transition with a stray character" "${ok/IMPL M5.Quiesce>Copy/IMPL M5.Quiesce>Copy;x}"
expect 1 "key inside another word" "${ok/Feature: O-SNAP-2/Not-Feature: O-SNAP-2}"
expect 1 "placeholder left in Feature" "${ok/Feature: O-SNAP-2/Feature: <roadmap item>}"
expect 1 "placeholder left in Red-first" "$(printf '%s\n' "$ok" | sed "s/^Red-first:.*/Red-first: <commit + test>/")"
expect 1 "placeholder left in Simplest" "$ok
Simplest: <the simplest version, and what this PR did not add>" M core/storage/gc.go
expect 1 "unfilled template" "$(cat "$here/../pull_request_template.md")"
expect 1 "core change without Simplest" "$ok" M core/storage/gc.go
expect 1 "cmd change, short Simplest" "$ok
Simplest: small" A cmd/sw-block/new.go
# expect_raw WANT_EXIT NAME BYTES: a change list given as printf format.
expect_raw() {
local want=$1 name=$2 got=0
printf "%s" "$ok" >"$tmp/body"
printf "$3" | bash "$check" "$tmp/body" >/dev/null 2>&1 || got=$?
if [[ $got != "$want" ]]; then
echo "FAIL $name: exit $got, want $want"
fail=1
fi
}
expect_raw 2 "record cut off before its NUL" "M\0core/storage/gc.go"
expect_raw 2 "status without a path" "M\0"
expect_raw 2 "status cut off before its NUL" "M\0docs/a.md\0M"
expect_raw 2 "unknown status" "R100\0core/a.go\0"
expect_raw 0 "well-formed docs change" "M\0docs/a.md\0"
# Kinds for PRs that change no behaviour: each is checked against its paths;
# DOCS also compares the old and new tokens of each changed non-test Go file.
# expect_kind WANT_EXIT NAME KIND OLD_GO NEW_GO [STATUS PATH]...
# OLD_GO/NEW_GO are core/x/s.go before and after ("-" = no blob for that side).
expect_kind() {
local want=$1 name=$2 k=$3 old=$4 new=$5 got=0
shift 5
printf '%s' "${ok/IMPL M5.Quiesce>Copy/$k}
$simplest" >"$tmp/body"
rm -rf "$tmp/blobs"; mkdir -p "$tmp/blobs/old/core/x" "$tmp/blobs/new/core/x"
[[ $old == - ]] || printf '%s' "$old" >"$tmp/blobs/old/core/x/s.go"
[[ $new == - ]] || printf '%s' "$new" >"$tmp/blobs/new/core/x/s.go"
if (($#)); then printf '%s\0' "$@"; fi | bash "$check" "$tmp/body" "$tmp/blobs" >/dev/null || got=$?
if [[ $got != "$want" ]]; then
echo "FAIL $name: exit $got, want $want"
fail=1
fi
}
P=$'package x\n'
expect_kind 0 "DOCS: comment-only Go" DOCS "${P}var A = 1"$'\n' "${P}"$'// A is one.\nvar A = 1 // one\n' M docs/a.md M core/x/s.go A core/x/s_test.go
expect_kind 0 "DOCS: gofmt realignment" DOCS "${P}var A = 1"$'\n' "${P}var A = 1"$'\n' M core/x/s.go
expect_kind 0 "DOCS: block comment" DOCS "${P}var A = 1"$'\n' "${P}"$'/* doc */\nvar A = 1\n' M core/x/s.go
expect_kind 1 "DOCS: reorder" DOCS "${P}func f() { u(); p() }"$'\n' "${P}func f() { p(); u() }"$'\n' M core/x/s.go
expect_kind 1 "DOCS: build constraint comment" DOCS "$P" $'//go:build never\n\npackage x\n' M core/x/s.go
expect_kind 1 "DOCS: rune quote then // in a string" DOCS "${P}var _ = f('\"', \"http://a\")"$'\n' "${P}var _ = f('\"', \"http://b\")"$'\n' M core/x/s.go
expect_kind 1 "DOCS: line inside a raw string" DOCS "${P}var s = \`a"$'\n'"curl http://old | sh"$'\n'"\`"$'\n' "${P}var s = \`a"$'\n'"curl http://new | sh"$'\n'"\`"$'\n' M core/x/s.go
expect_kind 1 "DOCS: spaces inside a string" DOCS "${P}var s = \"a b\""$'\n' "${P}var s = \"a b\""$'\n' M core/x/s.go
expect_kind 1 "DOCS: cgo preamble" DOCS "${P}// #include <a.h>"$'\nimport "C"\n' "${P}// #include <b.h>"$'\nimport "C"\n' M core/x/s.go
expect_kind 1 "DOCS: cgo preamble, grouped import" DOCS "${P}// #include <a.h>"$'\nimport (\n\t"C"\n)\n' "${P}// #include <b.h>"$'\nimport (\n\t"C"\n)\n' M core/x/s.go
expect_kind 1 "DOCS: Go changed, no blob" DOCS - - M core/x/s.go
expect_kind 1 "DOCS: a model under docs/spec" DOCS - - M docs/spec/X.tla
expect_kind 1 "DOCS: a non-docs, non-Go file" DOCS - - M deploy/x.env
expect_kind 0 "TEST: tests and testdata" TEST - - M core/x/s_test.go A core/x/testdata/in.bin
expect_kind 1 "TEST: production Go" TEST - - M core/x/s.go
expect_kind 0 "TEST: a runner scenario only" TEST - - A testops/scenarios/gate.yaml
expect_kind 0 "TEST: a scenario next to tests" TEST - - M testops/scenarios/gate.yaml M core/x/s_test.go
expect_kind 1 "TEST: a scenario next to production Go" TEST - - M testops/scenarios/gate.yaml M core/x/s.go
expect_kind 1 "TEST: a script beside the scenarios" TEST - - A testops/scenarios/run.sh
expect_kind 1 "TEST: a yaml outside testops/scenarios" TEST - - M testops/gate.yaml
expect_kind 0 "CI: workflow" CI - - M .github/workflows/w.yml
expect_kind 1 "CI: scripts/ is shipped" CI - - A scripts/install.sh
expect_kind 1 "DOCS next to another kind" "DOCS FIX INV-X-001" - - M docs/a.md
# The workflow supplies its base-owned map as the third argument.
expect_map() {
local want=$1 name=$2 model=$3 got=0
shift 3
printf '%s\n%s\n' "${ok/Model: docs\/spec\/MaintenanceOwner.tla, exhausted/Model: $model}" "$simplest" >"$tmp/body"
if (($#)); then printf '%s\0' "$@"; fi |
bash "$check" "$tmp/body" "" "$tmp/map.tsv" >/dev/null 2>&1 || got=$?
if [[ $got != "$want" ]]; then
echo "FAIL $name: exit $got, want $want"
fail=1
fi
}
printf 'core/x/s.go\tEngineAdapter.Begin\ncore/y/s.go\tMoveAdmission.Revoke\n' >"$tmp/map.tsv"
expect_map 0 "mapped action" "EngineAdapter.Begin" M core/x/s.go
expect_map 0 "mapped pure function" "NONE (pure function of EngineAdapter)" M core/x/s.go
expect_map 0 "all mapped modules cited" "EngineAdapter.Begin; MoveAdmission.Revoke" M core/x/s.go M core/y/s.go
expect_map 1 "mapped file rejects old prose" "docs/spec/EngineAdapter.tla, exhausted" M core/x/s.go
expect_map 1 "deleted mapped file still needs model" "NONE: deletion has no new code" D core/x/s.go
expect_map 1 "one citation cannot cover another module" "EngineAdapter.Begin" M core/x/s.go M core/y/s.go
expect_map 0 "unmapped file keeps old policy" "docs/spec/EngineAdapter.tla, exhausted" M core/z/s.go
printf '# no canonical rows yet\n' >"$tmp/map.tsv"
expect_map 2 "empty map is not silently disabled" "EngineAdapter.Begin" M core/x/s.go
[[ $fail == 0 ]] && echo "spec-trace self-test: ok"
exit $fail
-171
View File
@@ -1,171 +0,0 @@
#!/usr/bin/env bash
# Usage: spec-trace-check.sh BODY_FILE [BLOBS] [MODEL_MAP] < changes
#
# Checks the spec trace in a PR description. changes are NUL-separated
# STATUS, PATH pairs (post-merge-review-changed.sh).
#
# - Feature:, Machine/INV:, Model: and Red-first: each start a line (after
# optional indentation, a list marker or bold) and carry a value that is not
# a template placeholder; "NONE:" needs a reason of at least 10 characters.
# - Machine/INV: starts with exactly one PR kind: "IMPL <machine>.<transition>",
# "FIX <INV-ID>", "CHANGE <machine>", or one of the kinds a PR that changes
# no behaviour may use, each checked against what it changes:
# DOCS (docs outside docs/spec/, tests, and non-test Go whose tokens are
# unchanged: BLOBS holds old/<path> and new/<path> for each changed non-test
# Go file, compared by sametokens.go), TEST (only tests, testdata, test
# helpers and runner scenarios, testops/scenarios/*.yaml), CI (only
# .github/). NONE is not a kind. Known limit: a docs file that is
# go:embed-ed into a binary changes behaviour under DOCS (none today).
# - Simplest: (20+ characters) is present when the PR adds, modifies or
# deletes non-test Go under core/ or cmd/.
#
# Prints every problem and exits 1 if there is one; exits 0 if none, 2 on a
# usage error or a malformed change list.
set -euo pipefail
body_file=${1:?usage: spec-trace-check.sh BODY_FILE [BLOBS] < changes}
blobs=${2-}
model_map=${3-}
here=$(cd "$(dirname "$0")" && pwd)
[[ -f $body_file ]] || { echo "spec-trace: body file $body_file missing" >&2; exit 2; }
body=$(tr -d '\r' <"$body_file")
# value KEY: the text after KEY on the first line that starts with KEY,
# trimmed. A key inside another word ("Not-Feature:") does not count.
value() {
local line
line=$(printf '%s\n' "$body" | grep -m1 -E "^[[:space:]]*([-*][[:space:]]+)?(\*\*)?$1" || true)
[[ -n $line ]] || return 0
line=${line#*"$1"}
line=${line#\*\*}
line=${line#"${line%%[![:space:]]*}"}
printf '%s' "${line%"${line##*[![:space:]]}"}"
}
bad=0
problem() { echo "spec-trace: $1"; bad=1; }
# Each trace line is declared once: a second Machine/INV line could carry a
# second kind past the check.
for key in Feature: Machine/INV: Model: Red-first: Simplest:; do
n=$(printf '%s\n' "$body" | grep -cE "^[[:space:]]*([-*][[:space:]]+)?(\*\*)?$key" || true)
((n <= 1)) || problem "$key is declared $n times; declare it once"
done
for key in Feature: Machine/INV: Model: Red-first:; do
v=$(value "$key")
if [[ -z $v ]]; then
problem "missing or empty $key"
elif [[ $v == '<'* ]]; then
problem "$key still holds the template placeholder"
elif [[ $v == NONE:* ]]; then
r=${v#NONE:}
r=${r#"${r%%[![:space:]]*}"}
((${#r} >= 10)) || problem "$key NONE needs a reason of at least 10 characters"
fi
done
# One kind token, ending at the line end, a space, a comma or a slash.
end='($|[[:space:],/])'
kind_re="^(IMPL [A-Za-z0-9_]+[.][A-Za-z0-9_>.-]+|FIX INV-[A-Z0-9]+(-[A-Z0-9]+)*|CHANGE [A-Za-z0-9_]+|DOCS|TEST|CI)$end"
kind=""
mi=$(value Machine/INV:)
if [[ -n $mi && $mi != '<'* ]]; then
if [[ ! $mi =~ $kind_re ]]; then
problem "Machine/INV: must start with IMPL <machine>.<transition>, FIX <INV-ID>, CHANGE <machine>, DOCS, TEST or CI"
else
token=${BASH_REMATCH[1]}
if [[ ${mi#"${BASH_REMATCH[0]}"} =~ (^|[^A-Za-z0-9_])(IMPL|FIX|CHANGE|DOCS|TEST|CI)([^A-Za-z0-9_]|$) ]]; then
problem "Machine/INV: names more than one kind; a PR is exactly one kind"
else
kind=${token%% *}
fi
fi
fi
# A runner scenario under testops/scenarios/ is a test definition.
is_test() { [[ $1 == *_test.go || $1 == testdata/* || $1 == */testdata/* || $1 == */testutil/* || $1 == testops/scenarios/*.yaml ]]; }
# docs/spec holds the models: changing one is not a docs change.
is_doc() { [[ $1 != docs/spec/* ]] && [[ $1 == *.md || $1 == docs/* ]]; }
core=0
paths=()
while IFS= read -r -d '' status; do
[[ $status == [ADMT] ]] || { echo "spec-trace: malformed change list: status ${status@Q}" >&2; exit 2; }
IFS= read -r -d '' path || { echo "spec-trace: malformed change list: status $status without a path" >&2; exit 2; }
[[ -n $path ]] || { echo "spec-trace: malformed change list: empty path" >&2; exit 2; }
paths+=("$path")
if [[ $path == core/*.go || $path == cmd/*.go ]] && [[ $path != *_test.go ]]; then
core=1
fi
done
# A record cut off before its NUL is malformed, not skipped.
[[ -z ${status-} ]] || { echo "spec-trace: malformed change list: unterminated record" >&2; exit 2; }
if [[ -n $model_map ]]; then
model_status=0
{ if ((${#paths[@]})); then printf '%s\0' "${paths[@]}"; fi; } |
"${PYTHON:-python3}" -B "$here/model-trace-check.py" "$model_map" "$(value Model:)" || model_status=$?
case $model_status in
0) ;;
1) bad=1 ;;
*) exit "$model_status" ;;
esac
fi
if ((core)); then
s=$(value Simplest:)
if ((${#s} < 20)) || [[ $s == '<'* ]]; then
problem "Simplest: (20+ characters) is required when non-test Go under core/ or cmd/ changes"
fi
fi
case $kind in
CI)
for p in ${paths[@]+"${paths[@]}"}; do
[[ $p == .github/* ]] || problem "kind CI: $p is outside .github/ (scripts/ holds shipped install and deploy scripts)"
done
;;
TEST)
for p in ${paths[@]+"${paths[@]}"}; do
is_test "$p" || problem "kind TEST: $p is not a test, testdata or test helper"
done
;;
DOCS)
gofiles=()
for p in ${paths[@]+"${paths[@]}"}; do
if is_doc "$p" || is_test "$p"; then continue; fi
if [[ $p == *.go ]]; then gofiles+=("$p"); continue; fi
problem "kind DOCS: $p is neither docs, a test, nor Go"
done
if ((${#gofiles[@]})); then
if [[ -z $blobs || ! -d $blobs ]]; then
problem "kind DOCS: non-test Go changed but no old/new blobs were given to compare"
else
# Built here, not run with "go run": that would take the .go
# arguments as more source files of the program.
bin=$(mktemp -d)
trap 'rm -rf "$bin"' EXIT
if ! go build -o "$bin/sametokens" "$here/sametokens.go"; then
echo "spec-trace: could not build sametokens.go; the DOCS check did not run" >&2
exit 2
fi
for p in "${gofiles[@]}"; do
if [[ ! -e $blobs/old/$p && ! -e $blobs/new/$p ]]; then
problem "kind DOCS: $p has no old or new blob, so it was not compared"
continue
fi
rc=0
"$bin/sametokens" "$blobs/old/$p" "$blobs/new/$p" >/dev/null || rc=$?
case $rc in
0) ;;
1) problem "kind DOCS: $p changes more than comments (its Go tokens differ)" ;;
*)
echo "spec-trace: sametokens failed on $p (exit $rc); the DOCS check did not run" >&2
exit 2
;;
esac
done
fi
fi
;;
esac
exit $bad
-66
View File
@@ -1,66 +0,0 @@
name: Known bugs
# Nightly: every open-issue reproduction that is skipped by default (t.Skip unless
# SEAWEED_KNOWN_BUGS=1) runs and is EXPECTED TO FAIL. If one passes, its bug is
# fixed but its skip is still in place: this job fails and names it, so the skip
# is removed in the fix PR (or right after). A fix PR removes the test's line here
# together with its skip.
on:
schedule:
- cron: "17 6 * * *"
workflow_dispatch:
permissions:
contents: read
jobs:
known-bugs:
name: known-bug reproductions still fail
runs-on: tp04-seaweed-block
timeout-minutes: 15
env:
CGO_ENABLED: "0"
SEAWEED_KNOWN_BUGS: "1"
steps:
- name: Checkout
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
persist-credentials: false
- name: Runner disk is NVMe
# A self-hosted runner whose work, temp or Go cache directory sits on a
# SATA system disk times the process-level tests out under disk load;
# this names the runner and stops the job before it starts.
if: runner.environment == 'self-hosted'
run: |
bash .github/scripts/require-nvme-test.sh
bash .github/scripts/require-nvme.sh "$GITHUB_WORKSPACE" "$RUNNER_TEMP" "${TMPDIR:-/tmp}" "${GOCACHE:-$HOME/.cache/go-build}"
- name: Set up Go
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version-file: go.mod
cache: false
- name: Each reproduction still fails
run: |
set -u
ok=1
while read -r issue pkg test; do
[ -n "$issue" ] || continue
if go test -count=1 -run "^${test}\$" "$pkg" > "out-${test}.txt" 2>&1; then
echo "::error::${test} (${pkg}) now PASSES: ${issue} looks fixed, remove its skip"
ok=0
elif grep -q "^--- FAIL: ${test} " "out-${test}.txt"; then
echo "${test} (${issue}) still fails, as expected"
else
echo "::error::${test} (${pkg}) did not run or failed to build:"; tail -20 "out-${test}.txt"
ok=0
fi
done <<'LIST'
#186 ./cmd/blockmaster/ TestChartOptInLoopbackFlagIsAcceptedByBlockmaster
#187 ./cmd/blockmaster/ TestChartDefaultAuthorityStateSurvivesPodReplacement
#188 ./core/ops/ TestDeleteSafety_UntimedCleanupCannotProveFreshness
#189 ./core/storage/ TestMultiBlockRecordsRequireDistinctOnDiskImplVersion
LIST
[ "$ok" = 1 ]
-56
View File
@@ -1,56 +0,0 @@
name: post-merge-review paths
# A PR labelled "post-merge-review" may merge before its full review only if
# every changed file is allowed by .github/post-merge-review-allow.txt.
# This check fails such a PR otherwise; without the label it passes.
#
# pull_request_target: the workflow, the allow list and the script all come
# from the base branch, so a PR cannot change its own check. The PR's code is
# never checked out or run: only its commit is fetched, for the file list.
on:
pull_request_target:
# edited: a retarget changes the base, and with it the diff.
types: [opened, synchronize, reopened, labeled, unlabeled, edited]
permissions:
contents: read
concurrency:
group: post-merge-review-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
paths:
name: post-merge-review paths
# GitHub-hosted: on the self-hosted runners this job ended in 'Set up
# job' with no log on every runner (2026-11-29), while spec trace, on the
# same runners, passes. Unlabelled PRs only echo here, so the hosted
# queue costs little; the merge gate does not wait for it unless the PR
# is labelled.
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Not labelled
if: ${{ !contains(github.event.pull_request.labels.*.name, 'post-merge-review') }}
run: echo "no post-merge-review label; nothing to check"
- name: Checkout base
if: ${{ contains(github.event.pull_request.labels.*.name, 'post-merge-review') }}
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
ref: ${{ github.event.pull_request.base.sha }}
fetch-depth: 0
persist-credentials: false
- name: Check changed paths
if: ${{ contains(github.event.pull_request.labels.*.name, 'post-merge-review') }}
env:
BASE: ${{ github.event.pull_request.base.sha }}
HEAD: ${{ github.event.pull_request.head.sha }}
PR: ${{ github.event.pull_request.number }}
run: |
set -euo pipefail
bash .github/scripts/post-merge-review-check-test.sh
git -c fetch.fsckObjects=true fetch --no-tags origin "+refs/pull/${PR}/head:refs/remotes/pr/head"
bash .github/scripts/post-merge-review-changed.sh "$BASE" "$HEAD" >changed.bin
bash .github/scripts/post-merge-review-check.sh .github/post-merge-review-allow.txt <changed.bin
@@ -1,89 +0,0 @@
name: Publish alpha images
on:
workflow_dispatch:
push:
tags:
- "v*"
permissions:
contents: read
packages: write
env:
REGISTRY: ghcr.io
BLOCK_IMAGE: ghcr.io/seaweedfs/seaweed-block
CSI_IMAGE: ghcr.io/seaweedfs/seaweed-block-csi
jobs:
publish:
# Publish only from a version tag; a manual run from a branch must not move :alpha.
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # the tag list decides whether :alpha moves
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Compute image tags
id: tags
shell: bash
run: |
set -euo pipefail
# vX.Y.Z-pre (a release candidate) publishes only its own version tag. A stable vX.Y.Z also
# publishes sha-*, and moves :alpha only when it is the highest stable version tag, so a later
# patch on an older line never moves :alpha back.
short_sha="${GITHUB_SHA::12}"
version="${GITHUB_REF_NAME}"
if [[ ! "${version}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.]+)?$ ]]; then
echo "refusing to publish: tag ${version} is not vX.Y.Z or vX.Y.Z-pre" >&2
exit 1
fi
stable=false
move_alpha=false
if [[ "${version}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
stable=true
highest="$(git tag -l 'v*' | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -n 1)"
if [[ "${version}" == "${highest}" ]]; then
move_alpha=true
fi
fi
{
echo "block_tags<<EOF"
echo "${BLOCK_IMAGE}:${version}"
if [[ "${stable}" == true ]]; then echo "${BLOCK_IMAGE}:sha-${short_sha}"; fi
if [[ "${move_alpha}" == true ]]; then echo "${BLOCK_IMAGE}:alpha"; fi
echo "EOF"
echo "csi_tags<<EOF"
echo "${CSI_IMAGE}:${version}"
if [[ "${stable}" == true ]]; then echo "${CSI_IMAGE}:sha-${short_sha}"; fi
if [[ "${move_alpha}" == true ]]; then echo "${CSI_IMAGE}:alpha"; fi
echo "EOF"
} >> "$GITHUB_OUTPUT"
- name: Build and push block image
uses: docker/build-push-action@v6
with:
context: .
file: deploy/k8s/g15b/Dockerfile.sw-block
push: true
tags: ${{ steps.tags.outputs.block_tags }}
- name: Build and push CSI image
uses: docker/build-push-action@v6
with:
context: .
file: deploy/k8s/g15b/Dockerfile.blockcsi
push: true
tags: ${{ steps.tags.outputs.csi_tags }}
-88
View File
@@ -1,88 +0,0 @@
name: spec trace
# Every PR description carries the spec trace (see the PR template); this
# check fails a PR whose description does not.
#
# pull_request_target: the workflow and the script come from the base branch,
# so a PR cannot change its own check. The PR's code is never checked out or
# run: only its commit is fetched, for the file list. The description is read
# from the event through an environment variable, never interpolated.
on:
pull_request_target:
# edited: the check reads the description and the base.
types: [opened, synchronize, reopened, edited]
permissions:
contents: read
concurrency:
group: spec-trace-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
trace:
name: spec trace
# A PR from a branch of this repository runs on the team's self-hosted
# runners: the GitHub-hosted queue is shared with the whole organization,
# where this five-minute check waited behind other repositories' jobs.
# pull_request_target starts for any PR without approval, so a PR from a
# fork keeps a throw-away GitHub-hosted machine. No PR code is checked
# out or run on either.
runs-on: ${{ github.event.pull_request.head.repo.full_name == github.repository && 'tp04-seaweed-block' || 'ubuntu-latest' }}
timeout-minutes: 5
steps:
- name: Checkout base
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
# github.sha is the tip of the base branch when the event fires; the
# PR's base.sha can predate this workflow's own scripts.
ref: ${{ github.sha }}
fetch-depth: 0
persist-credentials: false
# spec-trace-check.sh builds the trusted sametokens.go; a self-hosted
# runner has no Go on its PATH unless the job sets it up.
- name: Set up Go
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version-file: go.mod
cache: false
- name: Check spec trace
env:
BASE: ${{ github.event.pull_request.base.sha }}
HEAD: ${{ github.event.pull_request.head.sha }}
PR: ${{ github.event.pull_request.number }}
BODY: ${{ github.event.pull_request.body }}
TITLE: ${{ github.event.pull_request.title }}
run: |
set -euo pipefail
bash .github/scripts/spec-trace-check-test.sh
python3 -B .github/scripts/model-trace-check-test.py
bash .github/scripts/changed-go-blobs-test.sh
# fsckObjects: a PR's objects are checked as they arrive, so a tree
# with a '..' or '.git' entry is refused here.
git -c fetch.fsckObjects=true fetch --no-tags origin "+refs/pull/${PR}/head:refs/remotes/pr/head"
printf '%s' "$BODY" >body.txt
bash .github/scripts/post-merge-review-changed.sh "$BASE" "$HEAD" >changed.bin
# Old and new blobs of each changed non-test Go file, for kind DOCS
# (objects only; a path that would leave blobs/ is refused).
mb=$(git merge-base "$BASE" "$HEAD")
bash .github/scripts/changed-go-blobs.sh "$mb" "$HEAD" blobs
# Mapping and validator come from the trusted base checkout above.
bash .github/scripts/spec-trace-check.sh body.txt blobs .github/model-code-trace.tsv <changed.bin
# Internal names stay out of this public repository: added lines,
# commit messages, title and description (no PR code is run).
bash .github/scripts/public-text-check-test.sh
printf '%s' "$TITLE" >title.txt
bash .github/scripts/public-text-check.sh "$mb" "$HEAD" title.txt body.txt
- name: Invariants ledger anchors (report only)
# Every code and test anchor of docs/design/invariants.md must exist at
# the PR's commit (git objects only; nothing from the PR is run). It
# reports and does not fail the check while the known imprecise
# anchors are being corrected; then this step becomes gating.
continue-on-error: true
env:
HEAD: ${{ github.event.pull_request.head.sha }}
run: python3 -I .github/scripts/ledger_check.py . "$HEAD" || true
-350
View File
@@ -1,350 +0,0 @@
name: Test
on:
pull_request:
# ready_for_review: a Draft runs no Go suite (below); marking it ready starts one.
types: [opened, synchronize, reopened, ready_for_review]
push:
branches:
- main
permissions:
contents: read
# One run per PR (or per branch for pushes). A new push to a PR cancels the
# superseded run; runs on main are never cancelled so every merge gets a result.
concurrency:
group: test-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
test:
# One job, two suites, one runner selection. 'unit' is the Go suite below;
# 'process' runs the process-level tests: real blockmaster, blockvolume and
# sw-block against a pinned SeaweedFS release. Those tests are named in
# .github/process-level-tests.txt, and every one must PASS, so a test that
# skips, fails, never starts or is cut off by the timeout fails the suite.
# Tests that need root or systemd are not in the list (see its header).
strategy:
fail-fast: false
matrix:
suite: [unit, process]
name: ${{ matrix.suite == 'unit' && 'go test (linux)' || 'process-level tests (real binaries)' }}
# The suite writes heavily to the runner disk (real files, fsync), so a
# Draft PR skips it; its author tests locally until the PR is ready.
if: github.event_name == 'push' || !github.event.pull_request.draft
# Pull requests run on GitHub-hosted runners (free for this public repo, many
# jobs in parallel); pushes to main keep the team's tp04 runner (seaweed.slice,
# capped at 8 cores / 8 GiB) as the self-hosted signal. A train PR (branch
# train/* of this repository, a few a day) also runs on the team's runners:
# it is the merge gate, and the organization's shared GitHub-hosted queue held
# it 30-55 minutes before it started. A PR from a fork never runs there.
runs-on: ${{ (github.event_name == 'push' || (github.event.pull_request.head.repo.full_name == github.repository)) && 'tp04-seaweed-block' || 'ubuntu-latest' }}
# process: 44 tests in 4 parallel shards of about 13 min each (55 min in sequence).
timeout-minutes: ${{ matrix.suite == 'unit' && 40 || 90 }}
env:
# Pure-Go build: no package in the default build needs cgo, and the
# hosted runner should not depend on a C toolchain being present.
CGO_ENABLED: "0"
steps:
- name: Checkout
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
persist-credentials: false
# Two commits: the PR merge commit and its base parent, so the test
# step can see which packages the PR touches.
fetch-depth: 2
- name: Runner disk is NVMe
# A self-hosted runner whose work, temp or Go cache directory sits on a
# SATA system disk times the process-level tests out under disk load;
# this names the runner and stops the job before it starts.
if: runner.environment == 'self-hosted'
run: |
bash .github/scripts/require-nvme-test.sh
bash .github/scripts/require-nvme.sh "$GITHUB_WORKSPACE" "$RUNNER_TEMP" "${TMPDIR:-/tmp}" "${GOCACHE:-$HOME/.cache/go-build}"
- name: Start whole-job load evidence
# Begins after checkout, before toolchain setup/build/tests. No host
# installation or privileged reads. A job-sized lifetime also bounds
# the sampler if cancellation prevents the stop step.
continue-on-error: true
env:
CI_EVIDENCE_DIR: ${{ runner.temp }}/ci-${{ matrix.suite }}-${{ github.run_id }}-${{ github.run_attempt }}
run: |
echo "CI_EVIDENCE_DIR=$CI_EVIDENCE_DIR" >>"$GITHUB_ENV"
mkdir -p "$CI_EVIDENCE_DIR"
: >"$CI_EVIDENCE_DIR/go-test.json"
python3 -I .github/scripts/ci-load.py start "$CI_EVIDENCE_DIR/load.tsv" --duration ${{ matrix.suite == 'unit' && 2400 || 5400 }}
- name: Self-test evidence capture
run: |
python3 -B .github/scripts/ci-load-test.py
bash .github/scripts/record-go-test-test.sh
- name: Docs-only pull request
id: scope
if: matrix.suite == 'process' && github.event_name == 'pull_request'
# A pull request that changes only files under docs/ runs no product
# code the process-level tests could exercise, so they are skipped and
# the job still reports success. HEAD is the merge commit, HEAD^1 its
# base parent (fetch-depth 2 above). Pushes to main always run them, and
# so does any error of the check (.github/scripts/docs-only-scope.sh).
run: |
set -euo pipefail
bash .github/scripts/docs-only-scope-test.sh
if out=$(bash .github/scripts/docs-only-scope.sh HEAD^1 HEAD); then
case $out in
"docs_only "*)
echo "skipped: docs only (${out#docs_only } files under docs/); the process-level tests run on the merge to main"
echo "docs_only=1" >>"$GITHUB_OUTPUT" ;;
*) echo "process-level tests run: $out" ;;
esac
else
echo "process-level tests run: the docs-only check failed"
fi
- name: Set up Go
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version-file: go.mod
# The self-hosted runner keeps GOCACHE/GOMODCACHE on its own disk;
# uploading them as an Actions cache (~4 GB) in the post step
# outlasted the job timeout after every test had passed. Only the
# GitHub-hosted (fork PR) runner uses the Actions cache.
cache: ${{ runner.environment == 'github-hosted' }}
cache-dependency-path: go.sum
- name: Go version
if: matrix.suite == 'unit'
run: go version
- name: Build
if: matrix.suite == 'unit'
run: go build ./...
- name: Vet
if: matrix.suite == 'unit'
run: go vet ./...
- name: Lab build tags stay out of images and releases
if: matrix.suite == 'unit'
# swblock_lab_bigvol lifts the 1 TiB create cap and the local
# headroom refusal for scale rehearsals only; swblock_v11_format turns
# on the draft v1.1 store format. The default test run pins the
# release cap (TestReleaseBuildKeepsTheCreateCap) and the release
# format. This step checks the tags' allowlist and that every image
# Dockerfile refuses a lab binary (scripts/refuse-lab-binary.sh) after
# its build, with controls, then tests each tag alone and both.
run: |
set -euo pipefail
bash .github/scripts/lab-tag-check.sh .
bash .github/scripts/lab-tag-check-test.sh
for tags in swblock_lab_bigvol swblock_v11_format swblock_lab_bigvol,swblock_v11_format; do
go vet -tags "$tags" ./core/geometry/ ./core/frontend/durable/ ./internal/buildinfo/ ./core/storage/
bash .github/scripts/record-go-test.sh "$CI_EVIDENCE_DIR/go-test.json" -count=1 -tags "$tags" -run 'Lab|Headroom|Revision|LegacyBound' ./core/geometry/ ./core/frontend/durable/ ./internal/buildinfo/
bash .github/scripts/record-go-test.sh "$CI_EVIDENCE_DIR/go-test.json" -count=1 -tags "$tags" -run 'TestV11FormatFollowsItsOwnTagAlone' ./core/storage/
done
- name: Test default configuration
if: matrix.suite == 'unit'
# The runner disk is shared, so the long, disk-heavy, timing-sensitive
# packages do not run here on main or on train PRs: every train runs the
# whole suite (both configurations) on a separate test VM before it
# merges, and main moves only by those trains. A PR runs the light set
# plus every heavy package its own diff touches.
env:
EVENT: ${{ github.event_name }}
HEAD_REF: ${{ github.head_ref }}
run: |
set -euo pipefail
pkgs=$(go list ./... | grep -vE '/core/(storage|frontend/durable|host/master|authority)$')
if [ "$EVENT" != push ] && [[ "$HEAD_REF" != train/* ]]; then
mod=$(go list -m)
changed=$(git diff --name-only HEAD^1 HEAD)
for p in core/storage core/frontend/durable core/host/master core/authority; do
if printf '%s\n' "$changed" | grep -qE "^$p/[^/]+$"; then
pkgs="$pkgs $mod/$p"
fi
done
fi
# 20m per package: core/storage alone took 602 s on tp04 on main
# (2026-11-22), past the old 10m, so any PR touching it failed.
bash .github/scripts/record-go-test.sh "$CI_EVIDENCE_DIR/go-test.json" -p=1 -short -count=1 -timeout 20m $pkgs
- name: Format v3 tagged tests
if: matrix.suite == 'unit'
# The swblock_format_v3_test tests of the four packages that carry them.
# Five durable tests are skipped by name: each installs a BASE on a chunk
# store, which no production path does (its invariant row is DORMANT);
# they are rewritten at the start of the next release, then this skip
# goes.
run: |
set -euo pipefail
skip='^(TestDurableProviderV3_AttachesCompletedChunkBASE|TestDurableProviderV3_CompletedBASEDoesNotRestoreOlderHEAD|TestDurableProviderV3_DefersBASERetirementUntilLocalPresence|TestDurableProviderV3_FreshMarkerCrashKeepsCompletedBASE|TestDurableProviderV3_FreshMarkerCaptureCrashKeepsCompletedBASE)$'
bash .github/scripts/record-go-test.sh "$CI_EVIDENCE_DIR/go-test.json" -p=1 -count=1 -timeout 20m -tags swblock_format_v3_test -skip "$skip" \
./core/frontend/durable/ ./core/recovery/ ./core/replication/ ./core/transport/
- name: Self-test of the required-tests gate
if: matrix.suite == 'process' && steps.scope.outputs.docs_only != '1'
# The gate must fail on a skip, a failure, a test that never ran, one
# cut off mid-run, and one that reports PASS and then exits nonzero or
# hangs; this proves it before it judges the real run.
run: |
python3 -I .github/scripts/required-tests-check-test.py
bash .github/scripts/chunkstore-scope-test.sh
bash .github/scripts/run-named-tests-test.sh
python3 -I .github/scripts/shard-named-tests-test.py
- name: Pinned SeaweedFS
if: matrix.suite == 'process' && steps.scope.outputs.docs_only != '1'
# The release archive is checked against its sha256 before every use,
# also when taken from the runner's cache; a mismatch fails the step.
# Nothing else is fetched.
env:
WEED_VERSION: "4.53"
WEED_SHA256: d1a7dec9f48d8b33895a0ea8951971defc2dc5312906dcc76fa5a5f74a6ee90d
run: |
set -euo pipefail
cache="${RUNNER_TOOL_CACHE:-$RUNNER_TEMP}/seaweedfs-weed/$WEED_VERSION"
tgz="$cache/linux_amd64.tar.gz"
mkdir -p "$cache"
if ! echo "$WEED_SHA256 $tgz" | sha256sum -c --status - 2>/dev/null; then
part="$tgz.$$.part"
curl -fsSL --retry 3 -o "$part" "https://github.com/seaweedfs/seaweedfs/releases/download/$WEED_VERSION/linux_amd64.tar.gz"
echo "$WEED_SHA256 $part" | sha256sum -c - || { rm -f "$part"; exit 1; }
mv -f "$part" "$tgz"
fi
bin="$RUNNER_TEMP/weed-$WEED_VERSION"
mkdir -p "$bin"
tar -xzf "$tgz" -C "$bin" weed
echo "CHUNKSTORE_WEED=$bin/weed" >>"$GITHUB_ENV"
- name: Real-filer integration tests
if: matrix.suite == 'process' && steps.scope.outputs.docs_only != '1'
# The chunkstore_integration tests run against the pinned weed above
# (master, volume and filer as real processes): the conditional HEAD
# writes, cut uploads and object deletes of the chunk store, and the
# layout sync crash cases of the durable provider. They fail, never
# skip, without the binary. Pushes to main and train PRs always run
# them; another PR runs them when it touches core/frontend/chunkstore/,
# core/storage/ or core/frontend/durable/.
env:
EVENT: ${{ github.event_name }}
HEAD_REF: ${{ github.head_ref }}
# .github/scripts/chunkstore-scope.sh decides; an error of that check
# runs the tests. Each filtered run must PASS at least one test, so a
# filter that matches nothing fails instead of passing empty.
run: |
set -euo pipefail
if [ "$EVENT" != push ] && [[ "$HEAD_REF" != train/* ]]; then
if out=$(bash .github/scripts/chunkstore-scope.sh HEAD^1 HEAD); then
case $out in
"skip "*) echo "skipped: the PR touches neither core/frontend/chunkstore/ nor core/storage/ ($out)"; exit 0 ;;
*) echo "real-filer integration tests run: $out" ;;
esac
else
echo "real-filer integration tests run: the scope check failed"
fi
fi
for spec in "./core/frontend/chunkstore/ ^TestIntegration" "./core/frontend/durable/ ^TestQD1LayoutSync"; do
pkg=${spec%% *}; filter=${spec#* }
log="$RUNNER_TEMP/integration-$(basename "$pkg").log"
bash .github/scripts/record-go-test.sh "$CI_EVIDENCE_DIR/go-test.json" -count=1 -v -timeout 20m -tags chunkstore_integration -run "$filter" "$pkg" 2>&1 | tee "$log"
grep -q '^--- PASS: ' "$log" || { echo "no test of $pkg matched $filter"; exit 1; }
done
- name: Build the binaries and the test binary once
if: matrix.suite == 'process' && steps.scope.outputs.docs_only != '1'
run: |
set -euo pipefail
bins="$RUNNER_TEMP/swblock-bins"
mkdir -p "$bins"
for b in blockmaster blockvolume sw-block; do go build -o "$bins/$b" "./cmd/$b"; done
go test -c -tags 'subprocess chunkstore_integration' -o "$bins/blockvolume.test" ./cmd/blockvolume
go test -c -o "$bins/blockcsi.test" ./cmd/blockcsi
# The known-zero acceptance's first-start crash step holds a test-only
# blockvolume (build tag kzhold, never released) at a chosen point.
go build -tags kzhold -o "$RUNNER_TEMP/blockvolume-kzhold" ./cmd/blockvolume
echo "SWBLOCK_TEST_BINS=$bins" >>"$GITHUB_ENV"
echo "KZ_HOLD_BIN=$RUNNER_TEMP/blockvolume-kzhold" >>"$GITHUB_ENV"
- name: Run the named process-level tests
if: matrix.suite == 'process' && steps.scope.outputs.docs_only != '1'
# Each named test in its own process of the one test binary, in
# sequence, so a panic or a hang in one cannot hide the others; each
# is bounded (TEST_TIMEOUT, then killed) and its exit status is kept:
# the gate needs a PASS event AND exit 0 for every named test. The known-zero acceptance
# runs its small shape (1 GiB, user-space client, no device); the
# 1 TiB run is lab only.
env:
KZ_RUN: "1"
KZ_SIZE: 1G
F1_RUN: "1"
TEST_TIMEOUT: 15m
# A failed test copies each daemon's whole log here (keepFullLog);
# the step below keeps them as the run's artifact.
SWBLOCK_TEST_LOG_DIR: ${{ env.CI_EVIDENCE_DIR }}/daemon-logs
run: |
set -euo pipefail
# SHARDS parallel shards, balanced by their last measured times
# (.github/process-level-seconds.txt). Each shard is its own sequence
# of test processes with its own slice of the test port ranges
# (SWBLOCK_TEST_PORT_SHARD) and its own TMPDIR; the gate judges every
# named test from all the shards together.
names=.github/process-level-tests.txt
# The manifest tags CSI entries; every other name uses blockvolume.test.
# The final checker still requires the complete, unsplit manifest.
awk '!/# package=blockcsi/' "$names" > "$RUNNER_TEMP/blockvolume-names.txt"
awk '/# package=blockcsi/ {sub(/#.*/, ""); if ($0 ~ /[^[:space:]]/) print}' "$names" > "$RUNNER_TEMP/blockcsi-names.txt"
test -s "$RUNNER_TEMP/blockcsi-names.txt"
shards=4
python3 -I .github/scripts/shard-named-tests.py "$RUNNER_TEMP/blockvolume-names.txt" .github/process-level-seconds.txt "$shards" "$RUNNER_TEMP/shard"
pids=()
for k in $(seq 1 "$shards"); do
mkdir -p "$RUNNER_TEMP/tmp-$k"
SWBLOCK_TEST_PORT_SHARD=$k SWBLOCK_TEST_PORT_SHARDS=$shards TMPDIR="$RUNNER_TEMP/tmp-$k" \
bash .github/scripts/run-named-tests.sh "$SWBLOCK_TEST_BINS/blockvolume.test" "$RUNNER_TEMP/shard/$k.txt" \
"$RUNNER_TEMP/process-level-$k.json" "$RUNNER_TEMP/process-level-$k.status" "$TEST_TIMEOUT" cmd/blockvolume \
>"$RUNNER_TEMP/process-level-$k.log" 2>&1 &
pids+=($!)
done
for p in "${pids[@]}"; do wait "$p" || true; done
for k in $(seq 1 "$shards"); do sed "s/^/[shard $k] /" "$RUNNER_TEMP/process-level-$k.log"; done
# CSI uses the same per-case isolation, timeout and verdict as the shards.
TEST_PKG=github.com/seaweedfs/seaweed-block/cmd/blockcsi \
bash .github/scripts/run-named-tests.sh "$SWBLOCK_TEST_BINS/blockcsi.test" "$RUNNER_TEMP/blockcsi-names.txt" \
"$RUNNER_TEMP/process-level-csi.json" "$RUNNER_TEMP/process-level-csi.status" "$TEST_TIMEOUT" cmd/blockcsi \
>"$RUNNER_TEMP/process-level-csi.log" 2>&1 || true
cat "$RUNNER_TEMP/process-level-csi.log"
cat "$RUNNER_TEMP"/process-level-*.status >"$RUNNER_TEMP/process-level.status"
python3 -I .github/scripts/required-tests-check.py --status "$RUNNER_TEMP/process-level.status" \
"$names" "$RUNNER_TEMP"/process-level-*.json
- name: Stop load evidence and collect raw process events
if: always()
continue-on-error: true
env:
SUITE: ${{ matrix.suite }}
run: |
if [ -z "${CI_EVIDENCE_DIR:-}" ]; then exit 0; fi
python3 -I .github/scripts/ci-load.py stop "$CI_EVIDENCE_DIR/load.tsv" || true
if [ "$SUITE" = process ]; then
mkdir -p "$CI_EVIDENCE_DIR/shards"
shopt -s nullglob
for file in "$RUNNER_TEMP"/process-level-*.json "$RUNNER_TEMP"/process-level-*.log "$RUNNER_TEMP"/process-level*.status; do
cp "$file" "$CI_EVIDENCE_DIR/shards/"
done
for file in "$CI_EVIDENCE_DIR"/shards/*.json; do cat "$file" >>"$CI_EVIDENCE_DIR/go-test.json"; done
fi
- name: Keep failed-job tests, load, daemon logs and shard results
# Both suites retain timed events and whole-job load. Process evidence
# also retains the original shard receipts and full daemon logs.
if: failure()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: ci-${{ matrix.suite }}-${{ github.run_id }}-${{ github.run_attempt }}
path: ${{ env.CI_EVIDENCE_DIR }}
retention-days: 14
if-no-files-found: warn
-35
View File
@@ -1,35 +0,0 @@
# Go toolchain caches (if GOCACHE/GOTMPDIR is pointed at the workspace)
.gocache/
.gotmp/
# Built binaries at repo root (sparrow is a command; tests build their own
# transient copies). Anchored with / so these do NOT match the cmd/sparrow/
# source directory's files.
/sparrow
/sparrow.exe
# Test coverage artifacts
*.test
*.out
coverage.out
# G5-5* cross-compile artifacts (m01 hardware iteration script
# stages binaries into _g5_bin/ before scp to the test host; root-
# level *.exe are Windows-side build outputs that go build leaves
# behind on iteration runs).
/_g5_bin/
/blockmaster
/blockmaster.exe
/blockvolume
/blockvolume.exe
# Local test runner outputs and ad-hoc Windows builds. Formal QA evidence lives
# under internal/docs/qa-assignments or external shared artifacts, not here.
/results/
/sw-testops.exe
# MkDocs engineering wiki build output
/site/
# Windows builds of the binaries (never committed)
/*.exe
-89
View File
@@ -1,89 +0,0 @@
# Agent Guidelines
Behavioral guidelines to reduce common LLM coding mistakes. Merge with
project-specific instructions as needed.
Tradeoff: these guidelines bias toward caution over speed. For trivial tasks,
use judgment.
## 1. Think Before Coding
Do not assume. Do not hide confusion. Surface tradeoffs.
Before implementing:
- State assumptions explicitly. If uncertain, ask.
- If multiple interpretations exist, present them; do not pick silently.
- If a simpler approach exists, say so. Push back when warranted.
- If something is unclear, stop, name what is confusing, and ask.
## 2. Simplicity First
Minimum code that solves the problem. Nothing speculative.
- No features beyond what was asked.
- No abstractions for single-use code.
- No flexibility or configurability that was not requested.
- No error handling for impossible scenarios.
- If 200 lines could be 50, rewrite it.
Ask: would a senior engineer say this is overcomplicated? If yes, simplify.
## 3. Surgical Changes
Touch only what you must. Clean up only your own mess.
When editing existing code:
- Do not improve adjacent code, comments, or formatting.
- Do not refactor things that are not broken.
- Match existing style, even if you would do it differently.
- If you notice unrelated dead code, mention it; do not delete it.
When your changes create orphans:
- Remove imports, variables, and functions that your changes made unused.
- Do not remove pre-existing dead code unless asked.
Every changed line should trace directly to the user's request.
## 4. Goal-Driven Execution
Define success criteria. Loop until verified.
Transform tasks into verifiable goals:
- "Add validation" -> "Write tests for invalid inputs, then make them pass."
- "Fix the bug" -> "Write a test that reproduces it, then make it pass."
- "Refactor X" -> "Ensure tests pass before and after."
For multi-step tasks, state a brief plan:
```text
1. [Step] -> verify: [check]
2. [Step] -> verify: [check]
3. [Step] -> verify: [check]
```
Strong success criteria let agents loop independently. Weak criteria such as
"make it work" require clarification.
These guidelines are working if there are fewer unnecessary changes in diffs,
fewer rewrites due to overcomplication, and clarifying questions come before
implementation rather than after mistakes.
## Protocol contract
Seaweed Block's state machines and invariants are in
[`docs/design/invariants.md`](docs/design/invariants.md). Read it before
changing a protocol path: the storage engines, durability and `Sync`,
authority and epochs, replication and replica roles, the chunk layer and the
cut, the catalog, GC and volume delete, or the workspace lease.
- Find the machine and transition (Part A) and the invariant IDs (Part B)
your change touches, and name them in the PR.
- Follow the change rules (Part C): a new or changed state or transition
updates Part A, the design-doc diagram, the ledger and the TLA+ spec that
covers it; an ACTIVE row never loses its test; a bug found by tests, soak
or TLA+ becomes a regression test plus a ledger row.
- Do not weaken a guard listed under "Enforced in" without updating its row.
-308
View File
@@ -1,308 +0,0 @@
# Seaweed Block
[![tag](https://img.shields.io/github/v/tag/seaweedfs/seaweed-block?sort=semver&label=release)](docs/releases/v1.0.0.md)
[![CI](https://github.com/seaweedfs/seaweed-block/actions/workflows/test.yml/badge.svg)](https://github.com/seaweedfs/seaweed-block/actions/workflows/test.yml)
[![Go](https://img.shields.io/github/go-mod/go-version/seaweedfs/seaweed-block)](go.mod)
[![License](https://img.shields.io/github/license/seaweedfs/seaweed-block)](LICENSE)
**Block storage for AI agent workspaces at local-disk speed, with snapshots, restore and moves backed by your own
[SeaweedFS](https://github.com/seaweedfs/seaweedfs).** Each sandbox or microVM gets a plain virtio block disk. Writes
and `fsync` complete on the host's local disk; cuts copy the changed data to SeaweedFS in the background. Losing the
host loses what was written since the last successful cut: normally about a day with the default schedule (one
snapshot a day), not a guaranteed bound; `--chunk-capture-interval` (5 minutes or more) cuts more often. The same core serves Kubernetes block volumes (alpha).
<p align="center">
<img src="docs/assets/seaweed-block-hero.svg" alt="Seaweed Block. Write path: an agent sandbox or microVM writes over NVMe/TCP or iSCSI to blockvolume, which completes the write and fsync on its local WAL and acknowledges; a write does not wait on SeaweedFS, except that a restored volume fetches each chunk from its snapshot once, on its first read or write. Background path: a cut (by default one scheduled snapshot a day; periodic cuts are optional) uploads only the changed 4 MiB chunks to your SeaweedFS, then updates the HEAD root with a conditional update on generation and epoch. blockmaster issues epochs and leases. Snapshots name a root and share chunks; a restore reads the snapshot's chunks on first use; a move hands the volume to another host at a higher epoch, and a stale holder's update is refused." width="100%">
</p>
**Branches.** `main` is v1.1 in development: it is not a release, and the store format it writes may change
before v1.1. Do not run it for data you keep. v1.0.x releases ship from the `release-1.0` branch.
## Install
The binaries are `blockmaster`, `blockvolume` and the `sw-block` CLI. The commands on this page are for v1.0.0.
**Option 1:** copy them from the v1.0.0 image,
`ghcr.io/seaweedfs/seaweed-block:v1.0.0` (index digest
`sha256:648980beb519a086349d44367e9d19ba6ae94b8939456ae3eb7b7bb5e4b3b28b`):
```bash
docker create --name swb-extract ghcr.io/seaweedfs/seaweed-block:v1.0.0
for b in blockmaster blockvolume sw-block; do docker cp swb-extract:/usr/local/bin/$b .; done
docker rm swb-extract && ./blockvolume --version
```
**Option 2:** build from the tag `v1.0.0` (the Go version in `go.mod`):
```bash
git clone --branch v1.0.0 https://github.com/seaweedfs/seaweed-block && cd seaweed-block
for b in blockmaster blockvolume sw-block; do go build -o $b ./cmd/$b; done
```
**Option 3:** Helm, see the [Kubernetes quick start](#quick-start-kubernetes-alpha).
Services: [standalone deployment](docs/standalone-deployment.md). Operator guide (supported setup, sizing, recovery point, host loss, limits): [operator guide](docs/operator-guide.md).
## Try it
The [first volume check](docs/standalone-deployment.md#first-volume-read-only-check)
starts `blockmaster` and one `blockvolume`, attaches a 256 MiB volume over
NVMe/TCP on loopback, shows the device and its status, and stops. It does
not format or write the attached device; it only creates local backing files
and logs. It needs Linux, bash, `nvme-cli`, `sudo` and the binaries
above. To format and write, use the [write test](docs/standalone-deployment.md#write-test-scratch-host-only) (scratch host only).
### `sw-block mini`
A trial on a scratch host, not for data you keep. One command starts a single-host
trial on loopback, with SeaweedFS's `weed mini` as the chunk store (run against SeaweedFS 4.53). Build all three
binaries from the same checkout and run the one you built, so that `mini` finds its matching `blockmaster` and
`blockvolume` next to it:
```bash
git clone https://github.com/seaweedfs/seaweed-block && cd seaweed-block
for b in blockmaster blockvolume sw-block; do go build -o $b ./cmd/$b; done
./sw-block mini --dir ./swb-mini --weed /path/to/weed
```
It starts `weed mini`, `blockmaster` and one `blockvolume` (volume `v1`, 256 MiB, `walstore-chunk` with its chunk
control endpoint). Snapshots of `v1` work at once. A restore into a new volume is not possible inside a `mini` trial
yet: `mini`'s blockmaster is its own child and `mini` stops everything when a child exits, and that blockmaster
refuses a volume that is not in its one-volume cluster spec while its product loop is off. To restore today, use the
standalone setup
([restoring a snapshot](docs/standalone-deployment.md#restoring-a-snapshot-into-a-new-volume)).
It prints every command it runs and never runs `sudo`: it prints the `nvme connect` command that attaches `v1`, and
the status, check and snapshot commands. Before you stop it with Ctrl-C, unmount `v1` and run the
`sudo nvme disconnect` it printed. If no `weed` is found on `PATH` and `--weed` is not given, it starts the local
engine only, with no snapshots and a banner saying so; a `--weed` path that does not exist is refused. More in
[standalone deployment](docs/standalone-deployment.md#quick-start-sw-block-mini).
## Why Seaweed Block
- **Close to local-disk speed for agent work.** In a pre-release run on the `walstore` engine (the local engine the
released chunk path builds on), `npm ci`, `git clone` and untar ran within 0-4% of a local disk for the operation
itself. With the final file-system flush included on both sides, they were 11-23% slower than the local disk, and
untar of 5,000 small files took about 2.2 times as long. On the released path, `fsync` costs about
1.3 times local ([measured results](#measured-results), [how each was measured](docs/workspace-measurements.md)).
- **`fsync` is durable on the host that serves the volume.** Every guest `fsync` reaches the host's disk; no write
cache is turned off to get the speed (a gate counts flushes against backend syncs, with an unsafe-cache control).
In fault injection on the release candidate (process kills and a store pause on one host; not a power-loss test),
0 acknowledged writes were lost across 253 judged; the same runs failed other operation checks, listed with the
record. If the host itself is lost, the volume comes back from its last cut
([records](docs/workspace-measurements.md)).
- **Snapshots in your object store.** A cut uploads only the changed 4 MiB chunks. A snapshot names a root of about
2 KB and shares its chunks; a restore makes a new volume that reads them on first use
([agent workspace design](docs/design/agent-workspace-design.md)).
- **Safe moves between hosts.** One blockmaster issues epochs and leases, and a holder admits I/O only while its own
lease is current; run exactly one blockmaster per cluster. Separately, every HEAD update is conditional on
`{gen, epoch}`, so the store refuses a stale holder's publish even before that holder notices it was replaced
([volume lifecycle](docs/volume-lifecycle.md), [TLA+ specifications](docs/spec/README.md)).
- **Self-hosted.** Go, Apache-2.0, on your own hosts and your own SeaweedFS.
- **Against an early FUSE prototype on the same host** (host-side, built on the SeaweedFS filer; not a released
product), in the same pre-release run, untar, `npm ci` and `git clone` were 4 to 36 times faster with the final
flush included; `fsync`-bound work took the same time ([record](docs/workspace-measurements.md)).
## Measured results
<picture>
<source media="(prefers-color-scheme: dark)" srcset="docs/assets/measured-results-dark.svg">
<img src="docs/assets/measured-results-light.svg" alt="Time on Seaweed Block relative to a local disk, over NVMe/TCP loopback: npm ci 1.00, git clone 1.02, untar 100,000 files 1.04, cold find and stat 0.97, 2,000 create plus write plus fsync 1.52, guest fsync median 1.31." width="100%">
</picture>
Lab runs, median of 3; not SLOs. Workloads: Firecracker microVMs (4 vCPU, 4 GiB) on one bare-metal host over
NVMe/TCP loopback, against a local file-backed disk. The first four rows come from a pre-release build on the
`walstore` engine and time the operation itself. With the final `syncfs` flush included on both sides (recorded
separately), the first three are 11-23% slower than the local disk (see the measurements page). The two `fsync` rows come from a later run of the released path
(`walstore-chunk`) on the same host, after the group-commit fix
([#173](https://github.com/seaweedfs/seaweed-block/pull/173)). The chart is drawn from
[measured-results.csv](docs/assets/measured-results.csv) by `docs/assets/readme-chart.py`.
| Measurement | Seaweed Block | Local disk |
|---|---|---|
| `npm ci` (617 packages, offline) / `git clone` (Go 1.23, local) | 2.14 s / 7.10 s | 2.14 s / 6.99 s |
| Untar 100,000 files / cold `find` + `stat` over them | 1.10 s / 0.32 s | 1.06 s / 0.33 s |
| 2,000 × create + write + `fsync` | 9.27 s | 6.11 s |
| Guest `fsync` median, fio 4 KiB random write, one at a time | 3.59 ms | 2.74 ms |
| Snapshot of a 10 GiB volume (2,560 chunks) | 0.18 ms | |
| Two-host lifecycle (pre-release): create, snapshot, fork, move, stale holder, delete, GC | 35 of 35 checks | |
The snapshot row is a host-side proxy without network latency, guest `fsync` or the block frontend. The two-host
lifecycle row is a pre-release run that included fork (removed from this release) and the earlier GC. The remaining
cost is `fsync`: a median of 3.59 ms against 2.74 ms local over NVMe/TCP loopback. The ublk frontend measured
3.23 ms in the same run; ublk is not among v1.0.0's supported frontends (NVMe/TCP and iSCSI).
[Workspace measurements](docs/workspace-measurements.md) has every number, the FUSE comparison and how each was
measured.
## Status and limits
- **Recovery point:** a lost host loses what was written since the volume's last successful snapshot or cut:
normally about a day with the default schedule (one scheduled snapshot a day, which is attempted, not
guaranteed). `--chunk-capture-interval`
(5 minutes or more) adds periodic cuts and shortens it.
- **v1.0.0 supports** the single-replica volume (`--durable-impl walstore-chunk`), backed up to SeaweedFS with
snapshots, restore, moves and volume delete. New volumes are at most 256 GiB. See the
[release note](docs/releases/v1.0.0.md) and its [known limits](docs/releases/v1.0.0.md#known-limits).
- **Replicated volumes** are a preview ([replicated volumes preview](docs/releases/replicated-volumes-preview.md)).
- **Kubernetes** is an alpha, for supported lab clusters ([Kubernetes status](docs/kubernetes-status.md)).
## Direction
Seaweed Block is block storage for AI agent workspaces: one local-speed disk per sandbox or microVM, with its history
(snapshots, restores, moves) in your own SeaweedFS. The same core serves Kubernetes block volumes (alpha).
- **Works today (v1.0.1):** single-replica volumes up to 256 GiB over NVMe/TCP or iSCSI; scheduled and manual
snapshots; restore into a new volume; a planned hand-over to another machine (run across two machines on the
release candidate); a forced move after a host is lost, from the volume's last cut (tested with two server
identities on one machine); volume delete. Each is a documented sequence of `sw-block ops` commands and systemd
units. v1.0.1 adds `sw-block mini`, a single-host trial; whole-job volume commands (`sw-block volume start`,
`stop`, `backup`, `restore`); `sw-block shell` for inspection, with `cluster.check` and a troubleshooting page; a
log bundle without secrets; and a working `ops chunk verify` (see the [v1.0.1 note](docs/releases/v1.0.1.md)).
- **After that, planned:** volumes up to 1 TiB (v1.1); replicated volumes beyond the preview; export of a snapshot to another object store, and
import from it; `volume fork` and `volume move` commands.
## Agent workspace disks: chunk lifecycle
The workspace path runs `blockvolume` with `--durable-impl=walstore-chunk`,
`--chunk-filer <filer>` and `--chunk-control-endpoint`, against a SeaweedFS
cluster. The `sw-block ops chunk` commands drive the lifecycle:
```bash
sw-block ops chunk cut --volume v1 --status-addr <status> # publish changed chunks, advance HEAD
sw-block ops chunk snapshot --volume v1 --status-addr <status> --name s1 # name a snapshot
sw-block ops chunk snapshots --master <blockmaster> --volume v1 --chunk-filer <filer> # list snapshots
sw-block ops chunk restore --master <blockmaster> --chunk-filer <filer> --source v1 --snapshot s1 --target v3 # new volume from a snapshot
sw-block ops chunk detach --volume v1 --status-addr <status> # final cut (seal); moving needs revoke + move, see docs/volume-lifecycle.md
sw-block ops chunk volume-delete --volume v3 --chunk-filer <filer> --master <blockmaster> --request-id del-v3
```
`volume-delete` is refused until the volume's holder has been revoked and its ACK
is recorded, and while the volume has snapshots: see
[Delete a volume](docs/volume-lifecycle.md#delete-a-volume).
Frozen detach and the pre-copy detach are not supported in this release: a
detach with `--frozen` (`frozen:true` on `POST /chunk/detach`) is refused with
409 `frozen_detach_unsupported`, and `blockvolume` refuses to start with
`--chunk-detach-precopy`.
`restore` creates the target from the snapshot; its blockvolume serves at
once and reads every chunk it has not made local from the source's snapshot
(there is no background copy). The source snapshot cannot be deleted while the
target exists. Fork is not supported in this release; the command is removed.
See [Restoring a snapshot](docs/standalone-deployment.md#restoring-a-snapshot-into-a-new-volume).
In v1.0.0 the chunk path (`walstore-chunk`) is the supported single-replica
configuration ([release note](docs/releases/v1.0.0.md), [operator guide](docs/operator-guide.md));
it is not the `--durable-impl` default.
## Quick start: Kubernetes (alpha)
For supported lab clusters, not production. From the repository root, with
`kubectl` and `helm` configured:
```bash
go build -o sw-block ./cmd/sw-block && export PATH="$PWD:$PATH"
sw-block ops generate-helm-values --out values.day1.yaml \
--image ghcr.io/seaweedfs/seaweed-block:sha-dc2972d0059b \
--csi-image ghcr.io/seaweedfs/seaweed-block-csi:sha-dc2972d0059b
helm install sw-block charts/seaweed-block --namespace kube-system \
--create-namespace -f values.day1.yaml --wait --timeout 10m
SW_BLOCK_INSTALL_MODE=helm SW_BLOCK_HELM_RELEASE=sw-block \
SW_BLOCK_HELM_NAMESPACE=kube-system SW_BLOCK_HELM_VALUES_FILE=values.day1.yaml \
bash scripts/run-basic-app-example.sh "$PWD"
```
The last command writes a PVC from one pod and reads it from a replacement
pod; expect `first_volume_status=ok` in
`/tmp/sw-block-basic-app-*/first-volume-summary.txt`. `sha-dc2972d0059b` is
the validated tag for the v0.4 read-only status path; later paths need
matching [release images](docs/kubernetes-status.md#release-images), and
`:alpha` is for smoke tests only. Each step's output is in the [Kubernetes
quickstart](docs/quickstart-kubernetes.md). To clean up:
```bash
helm uninstall sw-block --namespace kube-system
bash scripts/uninstall-k8s-alpha.sh "$PWD" && bash scripts/verify-helm-cleanup.sh
```
## Detailed status
| Area | Status |
|---|---|
| Agent workspace disks (`walstore-chunk`), single replica | Supported in v1.0.0; see its [known limits](docs/releases/v1.0.0.md#known-limits) |
| Replicated volumes (`replication_factor` above 1) | Preview in v1.0.0 ([replicated volumes preview](docs/releases/replicated-volumes-preview.md)) |
| Kubernetes: Helm install, PVC provisioning, writer/reader check, read-only report and dashboard, CRD status and Events, support-bundle replay | Available (alpha) |
| Kubernetes: RF=3 multi-volume, CSI reattach recovery, iSCSI ALUA/dm-multipath mounted failover, restart persistence with hostPath | Gated (supported lab) |
| Kubernetes: `SwBlockVolume` finalizer lifecycle owner, returned-replica ACK eligibility executor | Beta candidate |
| Kubernetes: NVMe/TCP CSI multipath, returned-replica failback runtime, WAL multi-block record opt-in | Source-gated |
| Kubernetes: backup, snapshot and restore; returned-replica rebuild traffic | Planned |
Full table and conditions: [Kubernetes status](docs/kubernetes-status.md);
run evidence: [release notes](docs/releases/README.md).
**Upgrade note:** blockmaster listens off loopback only with mutual TLS
(`--tls-cert`, `--tls-key`, `--tls-client-ca`, `--role-file`); the runtime HTTP
listener always stays on loopback, and `--insecure-external-bind` is refused.
The Helm chart and the shipped manifests run with mutual TLS; create their
Secrets first ([quickstart](docs/quickstart-kubernetes.md)).
### Not claimed yet
- Production readiness, SLOs, or a published performance, RTO or RPO claim.
- `fsync` parity with local disk. Today it is about 1.3× local over NVMe/TCP
(see Measured results).
- ublk at high density. Unprivileged per-volume servers need a privileged
control broker, which is not done.
- Crash-restart recovery of a ublk server. A crashed server fails closed.
- Multi-replica workspaces combined with chunk snapshots.
- The experimental engines `smartwal` and `parallel-walstore`: removed in
v1.1; their volumes are refused (copy the data to a walstore volume with
v1.0.x first).
- Kubernetes: backup and restore, a production operator, automatic failback
or cleanup, upgrade execution, broad compatibility, and more: see
[what you should not expect yet](docs/kubernetes-status.md#what-you-should-not-expect-yet).
## Correctness and verification
- **CI** runs `go build`, `go vet` and `go test -short` on every pull request
and push to `main` ([workflow](.github/workflows/test.yml)); that set leaves out the four
long, disk-heavy packages (a pull request runs those of them it changes);
they run in full, together with the legacy-fixture configuration, on a
separate test VM for every merge train (commit status `full-suite (pool VM)`
on the train head). Crash,
mutation, real-SeaweedFS and binary tests are described in the
[core design, Part 2](docs/design/block-design.md#part-2-verification-lessons-known-issues),
with the known issues.
- **Formal models**: [TLA+ specifications](docs/spec/README.md) of the
protocols where a bug would lose data. Counterexamples became fixes and
regression tests ([#152](https://github.com/seaweedfs/seaweed-block/pull/152), [#156](https://github.com/seaweedfs/seaweed-block/pull/156), [#158](https://github.com/seaweedfs/seaweed-block/pull/158), [#159](https://github.com/seaweedfs/seaweed-block/pull/159)).
- **Fail closed**: recovery that cannot establish a consistent image reports
a typed reason (`wal_corrupt`, `io_error`) instead of serving; some
suspected damage (`wal_hole_suspected`) is a status warning only.
## Documentation
- Design: [core](docs/design/block-design.md), [agent workspace](docs/design/agent-workspace-design.md),
[Kubernetes block](docs/design/kubernetes-block-design.md), [invariants and state machines](docs/design/invariants.md),
[TLA+ specifications](docs/spec/README.md),
[workspace measurements](docs/workspace-measurements.md)
- Operations: [standalone deployment](docs/standalone-deployment.md),
[volume lifecycle](docs/volume-lifecycle.md),
[Kubernetes quickstart](docs/quickstart-kubernetes.md), [user capabilities](docs/user-capabilities.md)
- Claims: [Kubernetes status](docs/kubernetes-status.md), [release notes](docs/releases/README.md),
[NVMe/TCP supported-lab claim](docs/releases/nvme-tcp-supported-lab.md),
[known issues and work in progress](docs/design/block-design.md#24-known-issues-and-work-in-progress)
- Engineering references, not release-claim sources: [architecture](docs/architecture.md),
[developer architecture](docs/developer-architecture.md), [runtime state machines](docs/runtime-state-machines.md)
## Development
```bash
go build ./... && go vet ./... && go test -short ./... # what CI runs
go test ./cmd/sw-block ./core/ops ./core/csi ./core/launcher ./core/host/master -count=1 # release-scoped
```
The full `go test ./...` sweep may include in-progress packages outside the
release gate. `scripts/activate-k8s-alpha.sh` remains for local images.
## Community
Questions and bug reports: [GitHub Issues](https://github.com/seaweedfs/seaweed-block/issues). Seaweed Block builds on
[SeaweedFS](https://github.com/seaweedfs/seaweedfs).
## License
Apache-2.0
@@ -1,5 +0,0 @@
.git/
.github/
results/
*.tmp
*.log
@@ -1,6 +0,0 @@
apiVersion: v2
name: seaweed-block
description: Seaweed Block Kubernetes CSI storage provider
type: application
version: 0.3.0-alpha.0
appVersion: "0.3-alpha"
@@ -1,173 +0,0 @@
# Seaweed Block Helm Chart
This chart installs the Seaweed Block alpha Kubernetes CSI stack:
- `sw-blockmaster`
- CSI controller
- CSI node DaemonSet
- optional `StorageClass`
- optional CHAP secret for cross-node iSCSI
The chart is read/write only through Kubernetes PVCs. It does not add a
mutating dashboard, operator reconciliation, backup/restore, or upgrade safety.
## Quick Install
Use generated values for the supported alpha install path. The generator reads
the live Kubernetes nodes and writes the node names/IPs that the launcher uses
for placement. On a single-node lab it keeps loopback/local-consumer mode; on a
multi-node lab it switches to non-loopback iSCSI with CHAP. For the
experimental NVMe/TCP path, pass `--protocol nvme`; this switches to
non-loopback NVMe/TCP, without enabling iSCSI CHAP.
blockmaster runs with mutual TLS, so create its Secrets before installing
(`tls.*` values name them; the helper issues development certificates, one
node certificate per server id).
```bash
SW_BLOCK_HELM_VALUES_OUT=values.day1.yaml \
bash scripts/generate-helm-values-day1.sh "$PWD"
bash scripts/k8s-alpha-certs.sh kube-system ~/.sw-block-alpha-tls <server id>...
helm install sw-block charts/seaweed-block \
--namespace kube-system \
-f values.day1.yaml
```
The raw chart defaults are render/development defaults only. Do not treat a
plain `helm install sw-block charts/seaweed-block` as a release-gated install:
it does not run preflight, does not discover the live Kubernetes node set, and
can leave placement/launcher evidence incomplete on real labs.
A complete three-node example is in
[`examples/values-3node.yaml`](examples/values-3node.yaml): image tags, network
and compat settings, CHAP, the StorageClass replication factor, and three
`blockNodes` (`node-a`, `node-b`, `node-c`, with RFC 5737 documentation
addresses). Copy it and replace the node names and addresses with your own:
```bash
helm install sw-block charts/seaweed-block -f my-values.yaml
```
`blockNodes[*].kubernetesNode` must match a real Kubernetes node name. The
`internalIP` is the management/control-plane address. `frontendIP` is optional;
when set, blockvolume `data_addr` and NVMe/TCP or iSCSI publish targets use
that address while `ctrl_addr` remains on `internalIP`. Use
`frontendNetworkClass: 100gbe_tcp` for a TCP frontend on the lab 100GbE data
network.
The source-gated NVMe/RDMA path is explicit and remains off by default:
```yaml
storageClass:
protocol: nvme
nvmeTransport: rdma
network:
externalNVMe: true
blockNodes:
- name: node-b
kubernetesNode: node-b
internalIP: 192.0.2.12
frontendIP: 198.51.100.12
frontendNetworkClass: 100gbe_roce
```
RDMA requires a non-loopback RoCE frontend address and host `nvme-rdma`,
`nvmet-rdma`, NBD, configfs, and RDMA-device prerequisites. This supported-lab
path does not claim RDMA multipath, failover, performance improvement, or an
SLO.
`network.rejectLoopbackPublishTargets` records the intended safety boundary.
Some blockmaster launcher flags are gated by `compat.*` settings because older
published alpha images do not accept every v0.3 flag. Keep
`compat.launcherDurableImplFlag`, `compat.launcherReplicationAckFlag`, and
`compat.launcherRejectLoopbackFlag` false unless the selected image is known to
support the corresponding flag. The default durable implementation is still
`walstore` because that is the blockmaster binary default when the
`--launcher-durable-impl` flag is omitted.
For source-gated NVMe/TCP write-path experiments, `nvme.maxH2CDataLength` can
be set explicitly. The chart default is `32768`; `65536` has a supported-lab
gate as an opt-in candidate. This is not a default change, NVMe/RDMA/RoCE
claim, or performance SLO.
For source-gated WAL write-path experiments, multi-block WAL records can be
enabled explicitly:
```yaml
blockmaster:
durableWALMultiBlockRecords: true
```
This is a lab-only optimization boundary backed by Phase 151/152/155 gates. It
is not a release-image claim until a matching-image smoke runs the explicit
opt-in recovery/status path. The default remains `false`. Do not set
`durableWALRecoveryTestDisableFlusher` outside recovery-test gates; that flag is
scaffolding used to force WAL replay evidence and is not a production tuning
knob.
## RF=3 Sync-Quorum Profile
For the gated RF=3 recovery shape:
```yaml
storageClass:
replicationFactor: 3
replication:
ackProfile: sync-quorum
expectedSlotsPerVolume: 3
network:
externalISCSI: true
externalNVMe: false
externalStatus: false
rejectLoopbackPublishTargets: true
chap:
enabled: true
username: swblock
secret: replace-with-a-real-secret
```
## Stage 2 Multipath Baseline
Stage 2 iSCSI ALUA/dm-multipath requires host prerequisites and is intentionally
opt-in:
```yaml
stage2Multipath:
enabled: true
```
This only enables chart wiring. The host still needs iSCSI, multipath, and ALUA
support configured.
## Optional Failback Runtime Wiring
Returned-replica failback execution is disabled by default. The chart only
renders the blockmaster failback RPC and executor runtime flags when all
execution switches are explicit:
```yaml
blockmaster:
failbackRuntimeRPC: true
failbackExecutor:
create: true
dryRun: false
execution:
enabled: true
policy: true
failbackRuntimeGrpcAddr: blockmaster.kube-system.svc:9333
```
The chart rejects unsafe combinations such as execution with `dryRun: true`,
missing execution policy, or both HTTP and gRPC runtime addresses. This wiring
does not enable automatic failback by default.
## Current Boundary
- Use immutable image tags such as `sha-<commit>` for QA and release checks.
- `:alpha` is a convenience tag and can drift from local source.
- Dynamic node discovery/onboarding is not yet handled by this chart. For now,
update `blockNodes` and run `helm upgrade`.
- Operator-managed node discovery, repair, and upgrade flows are future work.
@@ -1,318 +0,0 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: swblockclusters.block.seaweedfs.com
spec:
group: block.seaweedfs.com
scope: Namespaced
names:
plural: swblockclusters
singular: swblockcluster
kind: SwBlockCluster
shortNames:
- swbc
versions:
- name: v1alpha1
served: true
storage: true
subresources:
status: {}
additionalPrinterColumns:
- name: Ready
type: integer
jsonPath: .status.readyVolumeCount
- name: Blocked
type: integer
jsonPath: .status.blockedVolumeCount
- name: Stale
type: integer
jsonPath: .status.staleVolumeCount
- name: Age
type: date
jsonPath: .metadata.creationTimestamp
schema:
openAPIV3Schema:
type: object
description: Read-only Seaweed Block cluster status projection.
properties:
spec:
type: object
description: Declarative install metadata. Phase 35 does not reconcile spec into storage mutation.
properties:
image:
type: string
csiImage:
type: string
storageClass:
type: string
ackProfile:
type: string
protocol:
type: string
blockNodes:
type: array
items:
type: object
properties:
name:
type: string
internalIP:
type: string
frontendIP:
type: string
frontendNetworkClass:
type: string
status:
type: object
properties:
observedAt:
type: string
format: date-time
observedGeneration:
type: integer
format: int64
nodeCount:
type: integer
minimum: 0
nodes:
type: array
items:
type: object
required:
- name
- schedulable
- ready
properties:
name:
type: string
kubernetesNode:
type: string
internalIP:
type: string
frontendIP:
type: string
frontendNetworkClass:
type: string
schedulable:
type: boolean
ready:
type: boolean
status:
type: string
reasonCode:
type: string
lastHeartbeatAt:
type: string
format: date-time
replicaCount:
type: integer
minimum: 0
requiredImages:
type: array
items:
type: string
missingImages:
type: array
items:
type: string
conditions:
type: array
items:
x-kubernetes-preserve-unknown-fields: true
type: object
required:
- type
- status
properties:
type:
type: string
enum:
- Ready
- Recovered
- Recovering
- Blocked
- Invalid
- CleanupRequired
- EvidenceStale
status:
type: string
enum:
- "True"
- "False"
- Unknown
reason:
type: string
severity:
type: string
enum:
- info
- warning
- error
message:
type: string
lastTransitionTime:
type: string
format: date-time
evidenceRefs:
type: array
items:
type: string
evidenceRefs:
type: array
items:
type: string
volumeCount:
type: integer
minimum: 0
readyVolumeCount:
type: integer
minimum: 0
blockedVolumeCount:
type: integer
minimum: 0
staleVolumeCount:
type: integer
minimum: 0
conditions:
type: array
items:
x-kubernetes-preserve-unknown-fields: true
type: object
required:
- type
- status
properties:
type:
type: string
enum:
- Ready
- Recovered
- Recovering
- Blocked
- Invalid
- CleanupRequired
- EvidenceStale
status:
type: string
enum:
- "True"
- "False"
- Unknown
reason:
type: string
severity:
type: string
enum:
- info
- warning
- error
message:
type: string
lastTransitionTime:
type: string
format: date-time
evidenceRefs:
type: array
items:
type: string
evidenceRefs:
type: array
items:
type: string
supportBundleRefs:
type: array
items:
type: string
cleanup:
type: object
properties:
status:
type: string
k8sResidueCount:
type: integer
minimum: 0
iscsiResidueCount:
type: integer
minimum: 0
multipathResidueCount:
type: integer
minimum: 0
processResidueCount:
type: integer
minimum: 0
hostPathResidueCount:
type: integer
minimum: 0
failureCount:
type: integer
minimum: 0
failedPhase:
type: string
reasonCodes:
type: array
items:
type: string
evidenceRef:
type: string
installDrift:
type: object
properties:
status:
type: string
enum:
- ok
- mismatch
- unknown
reasonCode:
type: string
chartName:
type: string
currentChartVersion:
type: string
desiredChartVersion:
type: string
currentAppVersion:
type: string
desiredAppVersion:
type: string
currentImage:
type: string
desiredImage:
type: string
currentCsiImage:
type: string
desiredCsiImage:
type: string
currentOperatorImage:
type: string
desiredOperatorImage:
type: string
evidenceRef:
type: string
safeNextSteps:
type: array
items:
type: object
required:
- type
- mode
- mutationAllowed
properties:
type:
type: string
mode:
type: string
enum:
- read_only
- dry_run
- scripted
command:
type: string
reasonCode:
type: string
mutationAllowed:
type: boolean
evidenceRefs:
type: array
items:
type: string
@@ -1,174 +0,0 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: swblockfrontendpublications.block.seaweedfs.com
spec:
group: block.seaweedfs.com
scope: Namespaced
names:
plural: swblockfrontendpublications
singular: swblockfrontendpublication
kind: SwBlockFrontendPublication
shortNames:
- swbfp
versions:
- name: v1alpha1
served: true
storage: true
subresources:
status: {}
additionalPrinterColumns:
- name: Volume
type: string
jsonPath: .spec.volumeName
- name: Replica
type: string
jsonPath: .spec.replicaID
- name: State
type: string
jsonPath: .status.state
- name: Reason
type: string
jsonPath: .status.reasonCode
- name: Age
type: date
jsonPath: .metadata.creationTimestamp
schema:
openAPIV3Schema:
type: object
description: Narrow target for future frontend publication. Phase 69 creates the target only; it does not publish frontend paths.
properties:
spec:
type: object
description: Identity and terminal ACK evidence required before a future frontend publication executor may act.
required:
- volumeName
- replicaID
properties:
volumeName:
type: string
volumeID:
type: string
pvcName:
type: string
replicaID:
type: string
targetDataAddr:
type: string
targetCtrlAddr:
type: string
sourceEligibilityName:
type: string
sourceFailbackName:
type: string
ackEligibilityKnown:
type: boolean
ackEligible:
type: boolean
frontendFencedAfterExecution:
type: boolean
primaryUnchanged:
type: boolean
durableFrontierCovered:
type: boolean
noCrossVolumeIdentityChange:
type: boolean
failbackCompleted:
type: boolean
authorityEpochAdvanced:
type: boolean
singlePrimaryAfterFailback:
type: boolean
publishTargetSwappedAfterFailback:
type: boolean
frontendPublicationDecision:
type: string
enum:
- blocked
- disabled
- enabled
frontendPublicationReason:
type: string
frontendPublicationMutationAllowed:
type: boolean
runtimeEndpoint:
type: string
status:
type: object
properties:
observedAt:
type: string
format: date-time
observedGeneration:
type: integer
format: int64
minimum: 0
executor:
type: string
state:
type: string
enum:
- planned
- blocked
- published
reasonCode:
type: string
publicationMutationAllowed:
type: boolean
frontendPublished:
type: boolean
failbackStarted:
type: boolean
noStorageMutation:
type: boolean
noCrossVolumeIdentityChange:
type: boolean
evidenceGeneration:
type: string
conditions:
type: array
items:
type: object
required:
- type
- status
properties:
type:
type: string
enum:
- Ready
- Blocked
- Recovering
- Recovered
- EvidenceStale
status:
type: string
enum:
- "True"
- "False"
- Unknown
reason:
type: string
severity:
type: string
enum:
- info
- warning
- error
message:
type: string
lastTransitionTime:
type: string
format: date-time
evidenceRefs:
type: array
items:
type: string
evidenceRefs:
type: array
items:
type: string
nonClaims:
type: array
items:
type: string
@@ -1,137 +0,0 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: swblockreplicaeligibilities.block.seaweedfs.com
spec:
group: block.seaweedfs.com
scope: Namespaced
names:
plural: swblockreplicaeligibilities
singular: swblockreplicaeligibility
kind: SwBlockReplicaEligibility
shortNames:
- swbre
versions:
- name: v1alpha1
served: true
storage: true
subresources:
status: {}
additionalPrinterColumns:
- name: Volume
type: string
jsonPath: .spec.volumeName
- name: Replica
type: string
jsonPath: .spec.replicaID
- name: Eligible
type: boolean
jsonPath: .status.ackEligible
- name: Reason
type: string
jsonPath: .status.reasonCode
- name: Age
type: date
jsonPath: .metadata.creationTimestamp
schema:
openAPIV3Schema:
type: object
description: Narrow ACK eligibility evidence target for returned-replica reintegration.
properties:
spec:
type: object
description: Identity of the returned replica whose ACK eligibility may be recorded.
required:
- volumeName
- replicaID
properties:
volumeName:
type: string
volumeID:
type: string
pvcName:
type: string
replicaID:
type: string
status:
type: object
properties:
observedAt:
type: string
format: date-time
observedGeneration:
type: integer
format: int64
minimum: 0
executor:
type: string
reasonCode:
type: string
ackEligibilityKnown:
type: boolean
ackEligible:
type: boolean
frontendFencedAfterExecution:
type: boolean
primaryUnchanged:
type: boolean
durableFrontierCovered:
type: boolean
noCrossVolumeIdentityChange:
type: boolean
frontendPublicationDecision:
type: string
enum:
- blocked
- disabled
frontendPublicationReason:
type: string
frontendPublicationMutationAllowed:
type: boolean
evidenceGeneration:
type: string
conditions:
type: array
items:
type: object
required:
- type
- status
properties:
type:
type: string
enum:
- Ready
- Blocked
- EvidenceStale
status:
type: string
enum:
- "True"
- "False"
- Unknown
reason:
type: string
severity:
type: string
enum:
- info
- warning
- error
message:
type: string
lastTransitionTime:
type: string
format: date-time
evidenceRefs:
type: array
items:
type: string
evidenceRefs:
type: array
items:
type: string
nonClaims:
type: array
items:
type: string
@@ -1,163 +0,0 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: swblockreplicafailbacks.block.seaweedfs.com
spec:
group: block.seaweedfs.com
scope: Namespaced
names:
plural: swblockreplicafailbacks
singular: swblockreplicafailback
kind: SwBlockReplicaFailback
shortNames:
- swbrf
versions:
- name: v1alpha1
served: true
storage: true
subresources:
status: {}
additionalPrinterColumns:
- name: Volume
type: string
jsonPath: .spec.volumeName
- name: Replica
type: string
jsonPath: .spec.replicaID
- name: State
type: string
jsonPath: .status.state
- name: Reason
type: string
jsonPath: .status.reasonCode
- name: Age
type: date
jsonPath: .metadata.creationTimestamp
schema:
openAPIV3Schema:
type: object
description: Narrow target for future returned-replica authority failback. Phase 75 creates the target only; it does not mutate authority.
properties:
spec:
type: object
description: Identity and terminal ACK evidence required before a future failback executor may act.
required:
- volumeName
- replicaID
properties:
volumeName:
type: string
volumeID:
type: string
pvcName:
type: string
replicaID:
type: string
targetDataAddr:
type: string
targetCtrlAddr:
type: string
expectedCurrentReplicaID:
type: string
expectedCurrentEpoch:
type: integer
format: int64
minimum: 0
ackEligible:
type: boolean
frontendFencedBeforeFailback:
type: boolean
durableFrontierCovered:
type: boolean
noCrossVolumeIdentityChange:
type: boolean
failbackDecision:
type: string
enum: ["disabled", "enabled"]
failbackReason:
type: string
failbackMutationAllowed:
type: boolean
runtimeEndpoint:
type: string
status:
type: object
properties:
observedAt:
type: string
format: date-time
observedGeneration:
type: integer
format: int64
minimum: 0
executor:
type: string
state:
type: string
enum:
- planned
- blocked
- failed_back
reasonCode:
type: string
failbackMutationAllowed:
type: boolean
failbackStarted:
type: boolean
authorityEpochAdvanced:
type: boolean
singlePrimaryAfterFailback:
type: boolean
publishTargetSwappedAfterFailback:
type: boolean
noCrossVolumeIdentityChange:
type: boolean
evidenceGeneration:
type: string
conditions:
type: array
items:
type: object
required:
- type
- status
properties:
type:
type: string
enum:
- Ready
- Blocked
- Recovering
- Recovered
- EvidenceStale
status:
type: string
enum:
- "True"
- "False"
- Unknown
reason:
type: string
severity:
type: string
enum:
- info
- warning
- error
message:
type: string
lastTransitionTime:
type: string
format: date-time
evidenceRefs:
type: array
items:
type: string
evidenceRefs:
type: array
items:
type: string
nonClaims:
type: array
items:
type: string
@@ -1,188 +0,0 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: swblockreplicarebuilds.block.seaweedfs.com
spec:
group: block.seaweedfs.com
scope: Namespaced
names:
plural: swblockreplicarebuilds
singular: swblockreplicarebuild
kind: SwBlockReplicaRebuild
shortNames:
- swbrr
versions:
- name: v1alpha1
served: true
storage: true
subresources:
status: {}
additionalPrinterColumns:
- name: Volume
type: string
jsonPath: .spec.volumeName
- name: Replica
type: string
jsonPath: .spec.replicaID
- name: State
type: string
jsonPath: .status.state
- name: Reason
type: string
jsonPath: .status.reasonCode
- name: Age
type: date
jsonPath: .metadata.creationTimestamp
schema:
openAPIV3Schema:
type: object
description: Narrow status target for returned-replica rebuild/catch-up progress evidence.
properties:
spec:
type: object
description: Identity of the returned replica whose rebuild/catch-up progress may be recorded.
required:
- volumeName
- replicaID
properties:
volumeName:
type: string
volumeID:
type: string
pvcName:
type: string
replicaID:
type: string
sourceReplicaID:
type: string
runtimeEndpoint:
type: string
targetDataAddr:
type: string
sessionID:
type: integer
format: int64
minimum: 0
epoch:
type: integer
format: int64
minimum: 0
endpointVersion:
type: integer
format: int64
minimum: 0
fromLsn:
type: integer
format: int64
minimum: 0
frontierHintLsn:
type: integer
format: int64
minimum: 0
basePinLsn:
type: integer
format: int64
minimum: 0
status:
type: object
properties:
observedAt:
type: string
format: date-time
observedGeneration:
type: integer
format: int64
minimum: 0
executor:
type: string
state:
type: string
enum:
- planned
- blocked
- running
- caught_up
reasonCode:
type: string
frontendFencedBeforeRebuild:
type: boolean
primaryUnchanged:
type: boolean
durableFrontierKnown:
type: boolean
durableFrontierLsn:
type: integer
format: int64
minimum: 0
requiredFrontierKnown:
type: boolean
requiredFrontierLsn:
type: integer
format: int64
minimum: 0
durableFrontierCaughtUp:
type: boolean
rebuildTrafficStarted:
type: boolean
publicationDecision:
type: string
enum:
- blocked
- disabled
publicationReason:
type: string
publicationMutationAllowed:
type: boolean
noFrontendPublication:
type: boolean
noCrossVolumeIdentityChange:
type: boolean
evidenceGeneration:
type: string
conditions:
type: array
items:
type: object
required:
- type
- status
properties:
type:
type: string
enum:
- Ready
- Blocked
- Recovering
- Recovered
- EvidenceStale
status:
type: string
enum:
- "True"
- "False"
- Unknown
reason:
type: string
severity:
type: string
enum:
- info
- warning
- error
message:
type: string
lastTransitionTime:
type: string
format: date-time
evidenceRefs:
type: array
items:
type: string
evidenceRefs:
type: array
items:
type: string
nonClaims:
type: array
items:
type: string
@@ -1,442 +0,0 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: swblockvolumes.block.seaweedfs.com
spec:
group: block.seaweedfs.com
scope: Namespaced
names:
plural: swblockvolumes
singular: swblockvolume
kind: SwBlockVolume
shortNames:
- swbv
versions:
- name: v1alpha1
served: true
storage: true
subresources:
status: {}
additionalPrinterColumns:
- name: Status
type: string
jsonPath: .status.status
- name: Reason
type: string
jsonPath: .status.reasonCode
- name: PVC
type: string
jsonPath: .status.pvcName
- name: Age
type: date
jsonPath: .metadata.creationTimestamp
schema:
openAPIV3Schema:
type: object
description: Read-only Seaweed Block volume status projection.
properties:
spec:
type: object
description: PVC binding metadata. Phase 35 does not reconcile spec into storage mutation.
properties:
pvcName:
type: string
storageClass:
type: string
status:
type: object
properties:
volumeID:
type: string
pvcName:
type: string
primaryReplicaID:
type: string
publishTarget:
type: string
authorityEpoch:
type: integer
format: int64
minimum: 0
authorityEndpointVersion:
type: integer
format: int64
minimum: 0
status:
type: string
enum:
- ready
- recovered
- recovering
- degraded
- blocked
- invalid
- unsafe
- unknown
reasonCode:
type: string
observedAt:
type: string
format: date-time
conditions:
type: array
items:
x-kubernetes-preserve-unknown-fields: true
type: object
required:
- type
- status
properties:
type:
type: string
enum:
- Ready
- Recovered
- Recovering
- Blocked
- Invalid
- CleanupRequired
- EvidenceStale
status:
type: string
enum:
- "True"
- "False"
- Unknown
reason:
type: string
severity:
type: string
enum:
- info
- warning
- error
message:
type: string
lastTransitionTime:
type: string
format: date-time
evidenceRefs:
type: array
items:
type: string
deleteSafety:
type: object
properties:
actionType:
type: string
decision:
type: string
enum:
- allowed
- rejected
- unknown
state:
type: string
enum:
- not_requested
- requested
- blocked
- releasable
- released
reason:
type: string
finalizerReleaseAllowed:
type: boolean
missingFacts:
type: array
items:
type: string
evidenceRefs:
type: array
items:
type: string
safeNextAction:
type: string
nvme:
type: object
properties:
protocol:
type: string
enum:
- nvme
transport:
type: string
enum:
- tcp
- rdma
nqn:
type: string
nsid:
type: integer
format: int64
minimum: 0
nvmeAddr:
type: string
nvmeAddrs:
type: array
items:
type: string
pathCount:
type: integer
minimum: 0
multipathObserved:
type: boolean
anaState:
type: string
reasonCode:
type: string
replicaReintegrations:
type: array
items:
type: object
required:
- replicaID
- state
- frontendFenced
- frontendPrimaryReady
- ackEligibilityKnown
- ackEligible
- durableFrontierKnown
properties:
replicaID:
type: string
state:
type: string
enum:
- fenced
- recovering
- ready
- blocked
- unknown
reasonCode:
type: string
frontendFenced:
type: boolean
frontendPrimaryReady:
type: boolean
ackEligibilityKnown:
type: boolean
ackEligible:
type: boolean
durableFrontierKnown:
type: boolean
durableFrontierLsn:
type: integer
format: int64
minimum: 0
requiredFrontierKnown:
type: boolean
requiredFrontierLsn:
type: integer
format: int64
minimum: 0
runtimeEndpoint:
type: string
targetDataAddr:
type: string
targetCtrlAddr:
type: string
sessionID:
type: integer
format: int64
minimum: 0
epoch:
type: integer
format: int64
minimum: 0
endpointVersion:
type: integer
format: int64
minimum: 0
fromLsn:
type: integer
format: int64
minimum: 0
frontierHintLsn:
type: integer
format: int64
minimum: 0
basePinLsn:
type: integer
format: int64
minimum: 0
evidenceRefs:
type: array
items:
type: string
executorPreflights:
type: array
items:
type: object
required:
- actionType
- decision
- reason
- mode
- sideEffectClass
- ownerExecutor
- mutationAllowed
- frontendFenced
- ackEligibilityKnown
- ackEligible
- durableFrontierKnown
- requiredFrontierKnown
properties:
actionType:
type: string
replicaID:
type: string
decision:
type: string
enum:
- ready
- hold
reason:
type: string
mode:
type: string
enum:
- dry_run
sideEffectClass:
type: string
enum:
- authority_mutating
ownerExecutor:
type: string
mutationAllowed:
type: boolean
frontendFenced:
type: boolean
ackEligibilityKnown:
type: boolean
ackEligible:
type: boolean
durableFrontierKnown:
type: boolean
durableFrontierLsn:
type: integer
format: int64
minimum: 0
requiredFrontierKnown:
type: boolean
requiredFrontierLsn:
type: integer
format: int64
minimum: 0
evidenceRequired:
type: string
evidenceRefs:
type: array
items:
type: string
forbiddenMutationClass:
type: array
items:
type: string
executorContracts:
type: array
items:
type: object
required:
- actionType
- decision
- reason
- ownerExecutor
- executionEnabled
- mutationAllowed
properties:
actionType:
type: string
replicaID:
type: string
decision:
type: string
enum:
- blocked
- disabled
reason:
type: string
ownerExecutor:
type: string
executionEnabled:
type: boolean
mutationAllowed:
type: boolean
preflightDecision:
type: string
preflightReason:
type: string
allowedMutationClass:
type: array
items:
type: string
forbiddenMutationClass:
type: array
items:
type: string
terminalEvidenceRequired:
type: array
items:
type: string
evidenceRefs:
type: array
items:
type: string
nonClaims:
type: array
items:
type: string
evidenceRefs:
type: array
items:
type: string
allowedActions:
type: array
items:
type: object
required:
- type
- mode
- mutationAllowed
properties:
type:
type: string
mode:
type: string
enum:
- read_only
- dry_run
- scripted
sideEffectClass:
type: string
ownerExecutor:
type: string
decision:
type: string
enum:
- allowed
- rejected
- unknown
decisionReason:
type: string
missingFacts:
type: array
items:
type: string
mutationAllowed:
type: boolean
preconditions:
type: array
items:
type: string
invariantRefs:
type: array
items:
type: string
evidenceRequired:
type: string
evidenceRefs:
type: array
items:
type: string
@@ -1,48 +0,0 @@
# Example values for a three-node install (see ../README.md).
#
# Node names and addresses are placeholders. The addresses come from the
# RFC 5737 documentation ranges: 192.0.2.0/24 stands for the internal
# (management/control-plane) network and 198.51.100.0/24 for the frontend
# (data-plane) network. Replace them with your own Kubernetes node names and
# addresses; `sw-block ops generate-helm-values` derives them from the live
# cluster.
image:
tag: sha-<commit>
csiImage:
tag: sha-<commit>
network:
externalISCSI: true
externalNVMe: false
externalStatus: false # not supported with mutual TLS (the volume status stays on loopback)
rejectLoopbackPublishTargets: true
compat:
launcherDurableImplFlag: false
launcherReplicationAckFlag: false
launcherRejectLoopbackFlag: false
chap:
enabled: true
username: swblock
secret: replace-with-a-real-secret
storageClass:
replicationFactor: 1
blockNodes:
- name: node-a
kubernetesNode: node-a
internalIP: 192.0.2.11
frontendIP: 198.51.100.11
frontendNetworkClass: 100gbe_tcp
- name: node-b
kubernetesNode: node-b
internalIP: 192.0.2.12
frontendIP: 198.51.100.12
frontendNetworkClass: 100gbe_tcp
- name: node-c
kubernetesNode: node-c
internalIP: 192.0.2.13
frontendIP: 198.51.100.13
frontendNetworkClass: 100gbe_tcp
@@ -1,11 +0,0 @@
Seaweed Block has been rendered by Helm.
Next checks:
kubectl -n {{ .Release.Namespace }} wait --for=condition=available deploy/sw-blockmaster --timeout=120s
kubectl -n {{ .Release.Namespace }} wait --for=condition=available deploy/sw-block-csi-controller --timeout=120s
kubectl -n {{ .Release.Namespace }} rollout status ds/sw-block-csi-node --timeout=120s
Create volumes through Kubernetes PVCs using StorageClass {{ .Values.storageClass.name }}.
This chart is read-only/operator-free alpha packaging. It does not install a
mutating dashboard, operator CRDs, backup/restore, or upgrade safety.
@@ -1,100 +0,0 @@
{{/*
Common template helpers for Seaweed Block.
*/}}
{{- define "seaweed-block.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- define "seaweed-block.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name (include "seaweed-block.name" .) | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- define "seaweed-block.labels" -}}
app.kubernetes.io/name: {{ include "seaweed-block.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
{{- end -}}
{{- define "seaweed-block.image" -}}
{{- if .Values.image.digest -}}
{{- printf "%s@%s" .Values.image.repository .Values.image.digest -}}
{{- else -}}
{{- printf "%s:%s" .Values.image.repository .Values.image.tag -}}
{{- end -}}
{{- end -}}
{{- define "seaweed-block.csiImage" -}}
{{- if .Values.csiImage.digest -}}
{{- printf "%s@%s" .Values.csiImage.repository .Values.csiImage.digest -}}
{{- else -}}
{{- printf "%s:%s" .Values.csiImage.repository .Values.csiImage.tag -}}
{{- end -}}
{{- end -}}
{{- define "seaweed-block.statePermissionsImage" -}}
{{- if .Values.blockmaster.statePermissionsImage.digest -}}
{{- printf "%s@%s" .Values.blockmaster.statePermissionsImage.repository .Values.blockmaster.statePermissionsImage.digest -}}
{{- else -}}
{{- printf "%s:%s" .Values.blockmaster.statePermissionsImage.repository .Values.blockmaster.statePermissionsImage.tag -}}
{{- end -}}
{{- end -}}
{{- define "seaweed-block.blockmasterAddress" -}}
{{- printf "%s.%s.svc.cluster.local:%v" .Values.blockmaster.serviceName .Release.Namespace .Values.blockmaster.listenPort -}}
{{- end -}}
{{- define "seaweed-block.expectedSlotsPerVolume" -}}
{{- if gt (int .Values.replication.expectedSlotsPerVolume) 0 -}}
{{- .Values.replication.expectedSlotsPerVolume -}}
{{- else -}}
{{- .Values.storageClass.replicationFactor -}}
{{- end -}}
{{- end -}}
{{/* Mutual TLS toward blockmaster for an in-cluster client: its own Secret
(one of .Values.tls.clientSecrets, passed to masterTLSClientVolume)
mounted at /etc/sw-block/master-tls. */}}
{{- define "seaweed-block.masterTLSClientFlags" -}}
- "--master-tls-cert=/etc/sw-block/master-tls/tls.crt"
- "--master-tls-key=/etc/sw-block/master-tls/tls.key"
- "--master-ca=/etc/sw-block/master-tls/ca.crt"
{{- end -}}
{{- define "seaweed-block.masterTLSClientEnv" -}}
- name: SW_BLOCK_TLS_CERT
value: /etc/sw-block/master-tls/tls.crt
- name: SW_BLOCK_TLS_KEY
value: /etc/sw-block/master-tls/tls.key
- name: SW_BLOCK_TLS_CA
value: /etc/sw-block/master-tls/ca.crt
{{- end -}}
{{- define "seaweed-block.masterTLSClientMount" -}}
- name: master-tls
mountPath: /etc/sw-block/master-tls
readOnly: true
{{- end -}}
{{/* The CSI node and the status operator only read: refuse a Secret named
like an admin client's or blockmaster's own (the chart sees names, not
roles; the role file decides the role). */}}
{{- define "seaweed-block.readOnlyClientSecrets" -}}
{{- $s := .Values.tls.clientSecrets -}}
{{- if eq $s.csiNode $s.csiController $s.failbackExecutor .Values.tls.masterSecret -}}
{{- fail (printf "tls.clientSecrets.csiNode %q is the CSI controller's, the failback executor's or blockmaster's Secret: the node plugin never mounts an admin key" $s.csiNode) -}}
{{- end -}}
{{- if eq $s.operatorStatus $s.csiController $s.failbackExecutor .Values.tls.masterSecret -}}
{{- fail (printf "tls.clientSecrets.operatorStatus %q is the CSI controller's, the failback executor's or blockmaster's Secret: the status operator never mounts an admin key" $s.operatorStatus) -}}
{{- end -}}
{{- end -}}
{{- define "seaweed-block.masterTLSClientVolume" -}}
- name: master-tls
secret:
secretName: {{ . }}
{{- end -}}
@@ -1,49 +0,0 @@
{{- if and .Values.authorityExecutor.create .Values.authorityExecutor.rbac.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "seaweed-block.fullname" . }}-authority-executor
namespace: {{ .Release.Namespace }}
labels:
{{- include "seaweed-block.labels" . | nindent 4 }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "seaweed-block.fullname" . }}-authority-executor
labels:
{{- include "seaweed-block.labels" . | nindent 4 }}
rules:
- apiGroups: ["block.seaweedfs.com"]
resources: ["swblockvolumes"]
verbs: ["get", "list", "watch"]
{{- if .Values.authorityExecutor.execution.enabled }}
- apiGroups: ["block.seaweedfs.com"]
resources: ["swblockreplicaeligibilities"]
verbs: ["get", "list", "watch"]
- apiGroups: ["block.seaweedfs.com"]
resources: ["swblockreplicaeligibilities/status"]
verbs: ["get", "update", "patch"]
- apiGroups: ["block.seaweedfs.com"]
resources: ["swblockreplicarebuilds"]
verbs: ["get", "list", "watch"]
- apiGroups: ["block.seaweedfs.com"]
resources: ["swblockreplicarebuilds/status"]
verbs: ["get", "update", "patch"]
{{- end }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "seaweed-block.fullname" . }}-authority-executor
labels:
{{- include "seaweed-block.labels" . | nindent 4 }}
subjects:
- kind: ServiceAccount
name: {{ include "seaweed-block.fullname" . }}-authority-executor
namespace: {{ .Release.Namespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ include "seaweed-block.fullname" . }}-authority-executor
{{- end }}
@@ -1,41 +0,0 @@
{{- if .Values.authorityExecutor.create }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: sw-block-authority-executor
namespace: {{ .Release.Namespace }}
labels:
{{- include "seaweed-block.labels" . | nindent 4 }}
app: sw-block-authority-executor
spec:
replicas: 1
selector:
matchLabels:
app: sw-block-authority-executor
template:
metadata:
labels:
app: sw-block-authority-executor
{{- include "seaweed-block.labels" . | nindent 8 }}
spec:
serviceAccountName: {{ include "seaweed-block.fullname" . }}-authority-executor
{{- with .Values.authorityExecutor.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: authority-executor
image: {{ include "seaweed-block.image" . | quote }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["/usr/local/bin/sw-block"]
args:
- "ops"
- "authority-executor"
- "--namespace={{ .Release.Namespace }}"
- "--allowed-mutation-class={{ .Values.authorityExecutor.execution.allowedMutationClass }}"
{{- if .Values.authorityExecutor.execution.enabled }}
- "--execution-policy"
- "--enable-execution"
{{- end }}
- "--interval={{ .Values.authorityExecutor.interval }}"
{{- end }}
@@ -1,184 +0,0 @@
{{- if and .Values.network.externalISCSI (not .Values.chap.enabled) -}}
{{- fail "network.externalISCSI=true requires chap.enabled=true so cross-node iSCSI is not published without CHAP credentials" -}}
{{- end -}}
{{- if .Values.network.externalStatus -}}
{{- fail "network.externalStatus=true is not supported: blockmaster runs with mutual TLS and an authenticated volume's status listener stays on loopback" -}}
{{- end -}}
{{- if .Values.blockmaster.frontendPublicationRuntimeHTTP -}}
{{- fail "blockmaster.frontendPublicationRuntimeHTTP=true is not supported: the runtime HTTP API is unauthenticated and stays on loopback, out of reach of the executor pod" -}}
{{- end -}}
{{- if and (ne .Values.blockmaster.durableImpl "walstore") (not .Values.compat.launcherDurableImplFlag) -}}
{{- fail "blockmaster.durableImpl requires compat.launcherDurableImplFlag=true because older published images do not accept --launcher-durable-impl" -}}
{{- end -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: sw-blockmaster
namespace: {{ .Release.Namespace }}
labels:
{{- include "seaweed-block.labels" . | nindent 4 }}
app: sw-blockmaster
spec:
replicas: {{ .Values.blockmaster.replicas }}
selector:
matchLabels:
app: sw-blockmaster
template:
metadata:
labels:
app: sw-blockmaster
{{- include "seaweed-block.labels" . | nindent 8 }}
spec:
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
serviceAccountName: {{ include "seaweed-block.fullname" . }}-master
{{- with .Values.blockmaster.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.blockmaster.stateHostPath }}
initContainers:
- name: state-permissions
image: {{ include "seaweed-block.statePermissionsImage" . | quote }}
imagePullPolicy: {{ .Values.blockmaster.statePermissionsImage.pullPolicy }}
command: ["/bin/sh", "-c"]
args:
- "mkdir -p /var/lib/sw-block/authority /var/lib/sw-block/lifecycle && chown -R 65532:65532 /var/lib/sw-block"
securityContext:
runAsUser: 0
volumeMounts:
- name: state
mountPath: /var/lib/sw-block
{{- end }}
containers:
- name: blockmaster
image: {{ include "seaweed-block.image" . | quote }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["/usr/local/bin/blockmaster"]
args:
- "--authority-store={{ .Values.blockmaster.authorityStore }}"
- "--lifecycle-store={{ .Values.blockmaster.lifecycleStore }}"
- "--cluster-spec=/config/cluster-spec.yaml"
- "--lifecycle-product-loop-interval={{ .Values.blockmaster.lifecycleProductLoopInterval }}"
- "--launcher-loop-interval={{ .Values.blockmaster.launcherLoopInterval }}"
- "--launcher-manifest-dir={{ .Values.blockmaster.launcherManifestDir }}"
- "--launcher-master-addr={{ include "seaweed-block.blockmasterAddress" . }}"
- "--launcher-image={{ include "seaweed-block.image" . }}"
- "--launcher-namespace={{ .Release.Namespace }}"
- "--launcher-durable-root={{ .Values.blockmaster.durableRoot }}"
{{- if .Values.compat.launcherDurableImplFlag }}
- "--launcher-durable-impl={{ .Values.blockmaster.durableImpl }}"
{{- end }}
{{- if .Values.blockmaster.durableWALMultiBlockRecords }}
- "--launcher-durable-wal-multiblock-records"
{{- end }}
{{- if .Values.blockmaster.durableWALRecoveryTestDisableFlusher }}
- "--launcher-durable-wal-recovery-test-disable-flusher"
{{- end }}
{{- if .Values.blockmaster.launcherStatus }}
- "--launcher-status"
{{- end }}
{{- if .Values.compat.launcherReplicationAckFlag }}
- "--launcher-replication-ack={{ .Values.replication.ackProfile }}"
{{- end }}
- "--launcher-iscsi-port-base={{ .Values.ports.iscsiBase }}"
- "--launcher-nvme-port-base={{ .Values.ports.nvmeBase }}"
{{- if ne (int .Values.nvme.maxH2CDataLength) 32768 }}
- "--launcher-nvme-max-h2c-data-length={{ .Values.nvme.maxH2CDataLength }}"
{{- end }}
{{- if .Values.blockmaster.launcherPVCOwnerRef }}
- "--launcher-pvc-owner-ref"
{{- end }}
{{- if .Values.blockmaster.stateHostPath }}
- "--launcher-state-hostpath={{ .Values.blockmaster.stateHostPath }}"
{{- end }}
{{- if .Values.network.externalISCSI }}
- "--launcher-external-iscsi"
- "--launcher-iscsi-chap-secret-name={{ .Values.chap.secretName }}"
- "--launcher-iscsi-chap-username-key={{ .Values.chap.usernameKey }}"
- "--launcher-iscsi-chap-secret-key={{ .Values.chap.secretKey }}"
{{- end }}
{{- if .Values.network.externalNVMe }}
- "--launcher-external-nvme"
{{- end }}
{{- if and .Values.network.rejectLoopbackPublishTargets .Values.compat.launcherRejectLoopbackFlag }}
- "--launcher-reject-loopback-publish-targets"
{{- end }}
- "--launcher-kubernetes-apply"
- "--listen=0.0.0.0:{{ .Values.blockmaster.listenPort }}"
- "--tls-cert=/etc/sw-block/tls/tls.crt"
- "--tls-key=/etc/sw-block/tls/tls.key"
- "--tls-client-ca=/etc/sw-block/tls/ca.crt"
- "--role-file=/etc/sw-block/roles/roles"
- "--audit-log=/var/lib/sw-block/audit.log"
- "--launcher-master-tls-secret-prefix={{ .Values.tls.nodeSecretPrefix }}"
{{- if .Values.blockmaster.failbackRuntimeRPC }}
- "--failback-runtime-rpc"
{{- end }}
{{- if .Values.blockmaster.frontendPublicationRuntimeHTTP }}
- "--frontend-publication-runtime-http"
- "--frontend-publication-runtime-listen=0.0.0.0:{{ .Values.blockmaster.frontendPublicationRuntimePort }}"
{{- end }}
- "--expected-slots-per-volume={{ include "seaweed-block.expectedSlotsPerVolume" . }}"
ports:
- name: grpc
containerPort: {{ .Values.blockmaster.listenPort }}
{{- if .Values.blockmaster.frontendPublicationRuntimeHTTP }}
- name: frontend-http
containerPort: {{ .Values.blockmaster.frontendPublicationRuntimePort }}
{{- end }}
volumeMounts:
- name: cluster-spec
mountPath: /config
readOnly: true
- name: state
mountPath: /var/lib/sw-block
- name: manifests
mountPath: /manifests
- name: tls
mountPath: /etc/sw-block/tls
readOnly: true
- name: roles
mountPath: /etc/sw-block/roles
readOnly: true
volumes:
- name: cluster-spec
configMap:
name: {{ include "seaweed-block.fullname" . }}-cluster-spec
- name: state
{{- if .Values.blockmaster.stateHostPath }}
hostPath:
path: {{ .Values.blockmaster.stateHostPath | quote }}
type: {{ .Values.blockmaster.stateHostPathType | quote }}
{{- else }}
emptyDir: {}
{{- end }}
- name: manifests
emptyDir: {}
- name: tls
secret:
secretName: {{ .Values.tls.masterSecret }}
- name: roles
secret:
secretName: {{ .Values.tls.roleSecret }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.blockmaster.serviceName }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "seaweed-block.labels" . | nindent 4 }}
app: sw-blockmaster
spec:
selector:
app: sw-blockmaster
ports:
- name: grpc
port: {{ .Values.blockmaster.listenPort }}
targetPort: grpc
{{- if .Values.blockmaster.frontendPublicationRuntimeHTTP }}
- name: frontend-http
port: {{ .Values.blockmaster.frontendPublicationRuntimePort }}
targetPort: frontend-http
{{- end }}
@@ -1,27 +0,0 @@
{{- if and .Values.chap.enabled .Values.chap.create }}
apiVersion: v1
kind: Secret
metadata:
name: {{ .Values.chap.secretName }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "seaweed-block.labels" . | nindent 4 }}
type: Opaque
stringData:
{{ .Values.chap.usernameKey }}: {{ required "chap.username is required when chap.enabled=true" .Values.chap.username | quote }}
{{ .Values.chap.secretKey }}: {{ required "chap.secret is required when chap.enabled=true" .Values.chap.secret | quote }}
{{- if ne .Values.appNamespace .Release.Namespace }}
---
apiVersion: v1
kind: Secret
metadata:
name: {{ .Values.chap.secretName }}
namespace: {{ .Values.appNamespace }}
labels:
{{- include "seaweed-block.labels" . | nindent 4 }}
type: Opaque
stringData:
{{ .Values.chap.usernameKey }}: {{ .Values.chap.username | quote }}
{{ .Values.chap.secretKey }}: {{ .Values.chap.secret | quote }}
{{- end }}
{{- end }}
@@ -1,29 +0,0 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "seaweed-block.fullname" . }}-cluster-spec
namespace: {{ .Release.Namespace }}
labels:
{{- include "seaweed-block.labels" . | nindent 4 }}
data:
cluster-spec.yaml: |
nodes:
{{- range $i, $node := .Values.blockNodes }}
{{- $internalIP := required "blockNodes[].internalIP is required" $node.internalIP }}
{{- $frontendIP := default $internalIP $node.frontendIP }}
{{- $managementIP := default $internalIP $node.managementIP }}
- server_id: {{ default $node.name $node.serverID | quote }}
addr: {{ printf "%s:%v" $frontendIP (default 19101 $node.dataPort) | quote }}
data_addr: {{ printf "%s:%v" $frontendIP (default 19101 $node.dataPort) | quote }}
ctrl_addr: {{ printf "%s:%v" $internalIP (default 19102 $node.controlPort) | quote }}
labels:
kubernetes.io/hostname: {{ default $node.name $node.kubernetesNode | quote }}
sw-block.seaweedfs.com/management-ip: {{ $managementIP | quote }}
sw-block.seaweedfs.com/frontend-ip: {{ $frontendIP | quote }}
sw-block.seaweedfs.com/frontend-network-class: {{ default "management_lan" $node.frontendNetworkClass | quote }}
pools:
- pool_id: {{ default (printf "pool-%d" (add $i 1)) $node.poolID | quote }}
total_bytes: {{ default 1073741824 $node.totalBytes }}
free_bytes: {{ default 1073741824 $node.freeBytes }}
block_size: 4096
{{- end }}
@@ -1,75 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: sw-block-csi-controller
namespace: {{ .Release.Namespace }}
labels:
{{- include "seaweed-block.labels" . | nindent 4 }}
app: sw-block-csi-controller
spec:
replicas: {{ .Values.csiController.replicas }}
selector:
matchLabels:
app: sw-block-csi-controller
template:
metadata:
labels:
app: sw-block-csi-controller
{{- include "seaweed-block.labels" . | nindent 8 }}
spec:
serviceAccountName: {{ include "seaweed-block.fullname" . }}-csi
containers:
- name: block-csi
image: {{ include "seaweed-block.csiImage" . | quote }}
imagePullPolicy: {{ .Values.csiImage.pullPolicy }}
args:
- "--endpoint=unix:///csi/csi.sock"
- "--master=$(BLOCKMASTER_ADDR)"
- "--node-id=$(NODE_NAME)"
{{- include "seaweed-block.masterTLSClientFlags" . | nindent 12 }}
{{- if .Values.blockmaster.launcherPVCOwnerRef }}
- "--kubernetes-pvc-uid-lookup"
{{- end }}
{{- if or .Values.operatorStatus.create .Values.lifecycleOwner.create }}
- "--swblockvolume-cr-namespace={{ .Release.Namespace }}"
{{- end }}
{{- if .Values.stage2Multipath.enabled }}
- "--stage2-multipath"
{{- end }}
{{- if .Values.network.rejectLoopbackPublishTargets }}
- "--reject-loopback-publish-targets"
{{- end }}
env:
- name: BLOCKMASTER_ADDR
value: {{ include "seaweed-block.blockmasterAddress" . | quote }}
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
volumeMounts:
- name: socket-dir
mountPath: /csi
{{- include "seaweed-block.masterTLSClientMount" . | nindent 12 }}
- name: csi-provisioner
image: {{ .Values.sidecars.provisionerImage | quote }}
args:
- "--csi-address=/csi/csi.sock"
- "--timeout=30s"
- "--leader-election=true"
- "--extra-create-metadata=true"
volumeMounts:
- name: socket-dir
mountPath: /csi
- name: csi-attacher
image: {{ .Values.sidecars.attacherImage | quote }}
args:
- "--csi-address=/csi/csi.sock"
- "--timeout=30s"
- "--leader-election=true"
volumeMounts:
- name: socket-dir
mountPath: /csi
volumes:
- name: socket-dir
emptyDir: {}
{{- include "seaweed-block.masterTLSClientVolume" .Values.tls.clientSecrets.csiController | nindent 8 }}
@@ -1,12 +0,0 @@
apiVersion: storage.k8s.io/v1
kind: CSIDriver
metadata:
name: {{ .Values.driver.name }}
labels:
{{- include "seaweed-block.labels" . | nindent 4 }}
spec:
attachRequired: true
podInfoOnMount: false
fsGroupPolicy: File
volumeLifecycleModes:
- Persistent
@@ -1,120 +0,0 @@
{{- include "seaweed-block.readOnlyClientSecrets" . }}
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: sw-block-csi-node
namespace: {{ .Release.Namespace }}
labels:
{{- include "seaweed-block.labels" . | nindent 4 }}
app: sw-block-csi-node
spec:
selector:
matchLabels:
app: sw-block-csi-node
template:
metadata:
labels:
app: sw-block-csi-node
{{- include "seaweed-block.labels" . | nindent 8 }}
spec:
serviceAccountName: {{ include "seaweed-block.fullname" . }}-csi
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
hostPID: true
{{- if .Values.csiNode.loadKernelModules }}
initContainers:
- name: load-iscsi-tcp
image: {{ include "seaweed-block.csiImage" . | quote }}
imagePullPolicy: {{ .Values.csiImage.pullPolicy }}
command: ["/bin/sh", "-c"]
args:
- "modprobe iscsi_tcp || true; modprobe nvme_tcp || true; modprobe nvme_rdma || true; modprobe dm_multipath || true; modprobe scsi_dh_alua || true"
securityContext:
privileged: true
volumeMounts:
- name: modules-dir
mountPath: /lib/modules
readOnly: true
{{- end }}
containers:
- name: block-csi
image: {{ include "seaweed-block.csiImage" . | quote }}
imagePullPolicy: {{ .Values.csiImage.pullPolicy }}
args:
- "--endpoint=unix:///csi/csi.sock"
- "--master=$(BLOCKMASTER_ADDR)"
- "--node-id=$(NODE_NAME)"
{{- include "seaweed-block.masterTLSClientFlags" . | nindent 12 }}
{{- if .Values.stage2Multipath.enabled }}
- "--stage2-multipath"
{{- end }}
{{- if .Values.csiNode.nvmeReconnect.enabled }}
- "--nvme-reconnect-owner"
- "--nvme-reconnect-interval={{ .Values.csiNode.nvmeReconnect.interval }}"
{{- end }}
{{- if .Values.network.rejectLoopbackPublishTargets }}
- "--reject-loopback-publish-targets"
{{- end }}
env:
- name: BLOCKMASTER_ADDR
value: {{ include "seaweed-block.blockmasterAddress" . | quote }}
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
securityContext:
privileged: true
volumeMounts:
- name: socket-dir
mountPath: /csi
- name: kubelet-dir
mountPath: /var/lib/kubelet
mountPropagation: Bidirectional
- name: dev
mountPath: /dev
- name: iscsi-dir
mountPath: /etc/iscsi
- name: udev-run
mountPath: /run/udev
readOnly: true
{{- include "seaweed-block.masterTLSClientMount" . | nindent 12 }}
- name: csi-node-driver-registrar
image: {{ .Values.sidecars.nodeDriverRegistrarImage | quote }}
args:
- "--csi-address=/csi/csi.sock"
- "--kubelet-registration-path={{ .Values.csiNode.pluginPath }}/csi.sock"
volumeMounts:
- name: socket-dir
mountPath: /csi
- name: registration-dir
mountPath: /registration
volumes:
{{- include "seaweed-block.masterTLSClientVolume" .Values.tls.clientSecrets.csiNode | nindent 8 }}
- name: socket-dir
hostPath:
path: {{ .Values.csiNode.pluginPath | quote }}
type: DirectoryOrCreate
- name: kubelet-dir
hostPath:
path: {{ .Values.csiNode.kubeletPath | quote }}
type: Directory
- name: dev
hostPath:
path: /dev
type: Directory
- name: iscsi-dir
hostPath:
path: /etc/iscsi
type: DirectoryOrCreate
- name: udev-run
hostPath:
path: /run/udev
type: Directory
- name: modules-dir
hostPath:
path: /lib/modules
type: Directory
- name: registration-dir
hostPath:
path: {{ .Values.csiNode.registrationPath | quote }}
type: Directory
@@ -1,38 +0,0 @@
{{- if and .Values.failbackExecutor.create .Values.failbackExecutor.rbac.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "seaweed-block.fullname" . }}-failback-executor
namespace: {{ .Release.Namespace }}
labels:
{{- include "seaweed-block.labels" . | nindent 4 }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "seaweed-block.fullname" . }}-failback-executor
labels:
{{- include "seaweed-block.labels" . | nindent 4 }}
rules:
- apiGroups: ["block.seaweedfs.com"]
resources: ["swblockreplicafailbacks"]
verbs: ["get", "list", "watch"]
- apiGroups: ["block.seaweedfs.com"]
resources: ["swblockreplicafailbacks/status"]
verbs: ["get", "update", "patch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "seaweed-block.fullname" . }}-failback-executor
labels:
{{- include "seaweed-block.labels" . | nindent 4 }}
subjects:
- kind: ServiceAccount
name: {{ include "seaweed-block.fullname" . }}-failback-executor
namespace: {{ .Release.Namespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ include "seaweed-block.fullname" . }}-failback-executor
{{- end }}
@@ -1,72 +0,0 @@
{{- if .Values.failbackExecutor.create }}
{{- if and .Values.failbackExecutor.execution.enabled .Values.failbackExecutor.dryRun -}}
{{- fail "failbackExecutor.execution.enabled=true requires failbackExecutor.dryRun=false" -}}
{{- end -}}
{{- if and .Values.failbackExecutor.execution.enabled (not .Values.failbackExecutor.execution.policy) -}}
{{- fail "failbackExecutor.execution.enabled=true requires failbackExecutor.execution.policy=true" -}}
{{- end -}}
{{- if and .Values.failbackExecutor.execution.failbackRuntimeGrpcAddr (not .Values.failbackExecutor.execution.enabled) -}}
{{- fail "failbackExecutor.execution.failbackRuntimeGrpcAddr requires failbackExecutor.execution.enabled=true" -}}
{{- end -}}
{{- if and .Values.failbackExecutor.execution.failbackRuntimeURL (not .Values.failbackExecutor.execution.enabled) -}}
{{- fail "failbackExecutor.execution.failbackRuntimeURL requires failbackExecutor.execution.enabled=true" -}}
{{- end -}}
{{- if and .Values.failbackExecutor.execution.failbackRuntimeGrpcAddr .Values.failbackExecutor.execution.failbackRuntimeURL -}}
{{- fail "failbackExecutor.execution.failbackRuntimeGrpcAddr and failbackExecutor.execution.failbackRuntimeURL are mutually exclusive" -}}
{{- end -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: sw-block-failback-executor
namespace: {{ .Release.Namespace }}
labels:
{{- include "seaweed-block.labels" . | nindent 4 }}
app: sw-block-failback-executor
spec:
replicas: 1
selector:
matchLabels:
app: sw-block-failback-executor
template:
metadata:
labels:
app: sw-block-failback-executor
{{- include "seaweed-block.labels" . | nindent 8 }}
spec:
serviceAccountName: {{ include "seaweed-block.fullname" . }}-failback-executor
{{- with .Values.failbackExecutor.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: failback-executor
image: {{ include "seaweed-block.image" . | quote }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["/usr/local/bin/sw-block"]
args:
- "ops"
- "failback-executor"
- "--namespace={{ .Release.Namespace }}"
{{- if .Values.failbackExecutor.dryRun }}
- "--dry-run"
{{- end }}
{{- if .Values.failbackExecutor.execution.enabled }}
- "--enable-execution"
{{- end }}
{{- if .Values.failbackExecutor.execution.policy }}
- "--execution-policy"
{{- end }}
{{- if .Values.failbackExecutor.execution.failbackRuntimeGrpcAddr }}
- "--failback-runtime-grpc-addr={{ .Values.failbackExecutor.execution.failbackRuntimeGrpcAddr }}"
{{- end }}
{{- if .Values.failbackExecutor.execution.failbackRuntimeURL }}
- "--failback-runtime-url={{ .Values.failbackExecutor.execution.failbackRuntimeURL }}"
{{- end }}
- "--interval={{ .Values.failbackExecutor.interval }}"
env:
{{- include "seaweed-block.masterTLSClientEnv" . | nindent 12 }}
volumeMounts:
{{- include "seaweed-block.masterTLSClientMount" . | nindent 12 }}
volumes:
{{- include "seaweed-block.masterTLSClientVolume" .Values.tls.clientSecrets.failbackExecutor | nindent 8 }}
{{- end }}
@@ -1,38 +0,0 @@
{{- if and .Values.failbackTargetOwner.create .Values.failbackTargetOwner.rbac.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "seaweed-block.fullname" . }}-failback-target-owner
namespace: {{ .Release.Namespace }}
labels:
{{- include "seaweed-block.labels" . | nindent 4 }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "seaweed-block.fullname" . }}-failback-target-owner
labels:
{{- include "seaweed-block.labels" . | nindent 4 }}
rules:
- apiGroups: ["block.seaweedfs.com"]
resources: ["swblockvolumes"]
verbs: ["get", "list", "watch"]
- apiGroups: ["block.seaweedfs.com"]
resources: ["swblockreplicafailbacks"]
verbs: ["get", "list", "watch", "create"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "seaweed-block.fullname" . }}-failback-target-owner
labels:
{{- include "seaweed-block.labels" . | nindent 4 }}
subjects:
- kind: ServiceAccount
name: {{ include "seaweed-block.fullname" . }}-failback-target-owner
namespace: {{ .Release.Namespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ include "seaweed-block.fullname" . }}-failback-target-owner
{{- end }}
@@ -1,48 +0,0 @@
{{- if .Values.failbackTargetOwner.create }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: sw-block-failback-target-owner
namespace: {{ .Release.Namespace }}
labels:
{{- include "seaweed-block.labels" . | nindent 4 }}
app: sw-block-failback-target-owner
spec:
replicas: 1
selector:
matchLabels:
app: sw-block-failback-target-owner
template:
metadata:
labels:
app: sw-block-failback-target-owner
{{- include "seaweed-block.labels" . | nindent 8 }}
spec:
serviceAccountName: {{ include "seaweed-block.fullname" . }}-failback-target-owner
{{- with .Values.failbackTargetOwner.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: failback-target-owner
image: {{ include "seaweed-block.image" . | quote }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["/usr/local/bin/sw-block"]
args:
- "ops"
- "failback-target-owner"
- "--namespace={{ .Release.Namespace }}"
{{- if .Values.failbackTargetOwner.dryRun }}
- "--dry-run"
{{- end }}
- "--interval={{ .Values.failbackTargetOwner.interval }}"
{{- if .Values.failbackTargetOwner.activation.enabled }}
- "--activate-targets"
{{- end }}
{{- if .Values.failbackTargetOwner.activation.policy }}
- "--activation-policy"
{{- end }}
{{- if .Values.failbackTargetOwner.activation.runtimeEndpoint }}
- "--runtime-endpoint={{ .Values.failbackTargetOwner.activation.runtimeEndpoint }}"
{{- end }}
{{- end }}
@@ -1,32 +0,0 @@
{{- if and .Values.frontendPublicationExecutor.create .Values.frontendPublicationExecutor.rbac.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "seaweed-block.fullname" . }}-frontend-publication-executor
namespace: {{ .Release.Namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "seaweed-block.fullname" . }}-frontend-publication-executor
rules:
- apiGroups: ["block.seaweedfs.com"]
resources: ["swblockfrontendpublications"]
verbs: ["get", "list", "watch"]
- apiGroups: ["block.seaweedfs.com"]
resources: ["swblockfrontendpublications/status"]
verbs: ["get", "update", "patch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "seaweed-block.fullname" . }}-frontend-publication-executor
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ include "seaweed-block.fullname" . }}-frontend-publication-executor
subjects:
- kind: ServiceAccount
name: {{ include "seaweed-block.fullname" . }}-frontend-publication-executor
namespace: {{ .Release.Namespace }}
{{- end }}
@@ -1,46 +0,0 @@
{{- if .Values.frontendPublicationExecutor.create }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: sw-block-frontend-publication-executor
namespace: {{ .Release.Namespace }}
labels:
app: sw-block-frontend-publication-executor
spec:
replicas: 1
selector:
matchLabels:
app: sw-block-frontend-publication-executor
template:
metadata:
labels:
app: sw-block-frontend-publication-executor
spec:
serviceAccountName: {{ include "seaweed-block.fullname" . }}-frontend-publication-executor
{{- with .Values.frontendPublicationExecutor.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
containers:
- name: frontend-publication-executor
image: {{ include "seaweed-block.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["/usr/local/bin/sw-block"]
args:
- "ops"
- "frontend-publication-executor"
- "--namespace={{ .Release.Namespace }}"
{{- if .Values.frontendPublicationExecutor.dryRun }}
- "--dry-run"
{{- end }}
{{- if .Values.frontendPublicationExecutor.execution.enabled }}
- "--enable-execution"
{{- end }}
{{- if .Values.frontendPublicationExecutor.execution.policy }}
- "--execution-policy"
{{- end }}
{{- if .Values.frontendPublicationExecutor.execution.runtimeUrl }}
- "--frontend-publication-runtime-url={{ .Values.frontendPublicationExecutor.execution.runtimeUrl }}"
{{- end }}
- "--interval={{ .Values.frontendPublicationExecutor.interval }}"
{{- end }}
@@ -1,35 +0,0 @@
{{- if and .Values.frontendPublicationTargetOwner.create .Values.frontendPublicationTargetOwner.rbac.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "seaweed-block.fullname" . }}-frontend-publication-target-owner
namespace: {{ .Release.Namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "seaweed-block.fullname" . }}-frontend-publication-target-owner
rules:
- apiGroups: ["block.seaweedfs.com"]
resources: ["swblockreplicaeligibilities"]
verbs: ["get", "list", "watch"]
- apiGroups: ["block.seaweedfs.com"]
resources: ["swblockreplicafailbacks"]
verbs: ["get", "list", "watch"]
- apiGroups: ["block.seaweedfs.com"]
resources: ["swblockfrontendpublications"]
verbs: ["get", "list", "watch", "create"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "seaweed-block.fullname" . }}-frontend-publication-target-owner
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ include "seaweed-block.fullname" . }}-frontend-publication-target-owner
subjects:
- kind: ServiceAccount
name: {{ include "seaweed-block.fullname" . }}-frontend-publication-target-owner
namespace: {{ .Release.Namespace }}
{{- end }}
@@ -1,46 +0,0 @@
{{- if .Values.frontendPublicationTargetOwner.create }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: sw-block-frontend-publication-target-owner
namespace: {{ .Release.Namespace }}
labels:
app: sw-block-frontend-publication-target-owner
spec:
replicas: 1
selector:
matchLabels:
app: sw-block-frontend-publication-target-owner
template:
metadata:
labels:
app: sw-block-frontend-publication-target-owner
spec:
serviceAccountName: {{ include "seaweed-block.fullname" . }}-frontend-publication-target-owner
{{- with .Values.frontendPublicationTargetOwner.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
containers:
- name: frontend-publication-target-owner
image: {{ include "seaweed-block.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["/usr/local/bin/sw-block"]
args:
- "ops"
- "frontend-publication-target-owner"
- "--namespace={{ .Release.Namespace }}"
{{- if .Values.frontendPublicationTargetOwner.dryRun }}
- "--dry-run"
{{- end }}
{{- if .Values.frontendPublicationTargetOwner.activation.enabled }}
- "--activate-targets"
{{- end }}
{{- if .Values.frontendPublicationTargetOwner.activation.policy }}
- "--activation-policy"
{{- end }}
{{- if .Values.frontendPublicationTargetOwner.activation.runtimeEndpoint }}
- "--runtime-endpoint={{ .Values.frontendPublicationTargetOwner.activation.runtimeEndpoint }}"
{{- end }}
- "--interval={{ .Values.frontendPublicationTargetOwner.interval }}"
{{- end }}
@@ -1,47 +0,0 @@
{{- if and .Values.lifecycleOwner.create .Values.lifecycleOwner.admission.create }}
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingAdmissionPolicy
metadata:
name: {{ include "seaweed-block.fullname" . }}-lifecycle-owner-finalizer-boundary
labels:
{{- include "seaweed-block.labels" . | nindent 4 }}
spec:
failurePolicy: Fail
matchConstraints:
resourceRules:
- apiGroups: ["block.seaweedfs.com"]
apiVersions: ["v1alpha1"]
operations: ["UPDATE"]
resources: ["swblockvolumes"]
validations:
- expression: >-
request.userInfo.username != "system:serviceaccount:{{ .Release.Namespace }}:{{ include "seaweed-block.fullname" . }}-lifecycle-owner" ||
(
(has(object.spec) == has(oldObject.spec)) &&
(!has(object.spec) || object.spec == oldObject.spec) &&
(has(object.status) == has(oldObject.status)) &&
(!has(object.status) || object.status == oldObject.status) &&
(has(object.metadata.labels) == has(oldObject.metadata.labels)) &&
(!has(object.metadata.labels) || object.metadata.labels == oldObject.metadata.labels) &&
(has(object.metadata.annotations) == has(oldObject.metadata.annotations)) &&
(!has(object.metadata.annotations) || object.metadata.annotations == oldObject.metadata.annotations) &&
(has(object.metadata.ownerReferences) == has(oldObject.metadata.ownerReferences)) &&
(!has(object.metadata.ownerReferences) || object.metadata.ownerReferences == oldObject.metadata.ownerReferences) &&
(has(object.metadata.deletionTimestamp) == has(oldObject.metadata.deletionTimestamp)) &&
(!has(object.metadata.deletionTimestamp) || object.metadata.deletionTimestamp == oldObject.metadata.deletionTimestamp) &&
((has(object.metadata.finalizers) ? object.metadata.finalizers : []).filter(f, f != "{{ .Values.lifecycleOwner.finalizerName | default "block.seaweedfs.com/swblockvolume-protection" }}") ==
(has(oldObject.metadata.finalizers) ? oldObject.metadata.finalizers : []).filter(f, f != "{{ .Values.lifecycleOwner.finalizerName | default "block.seaweedfs.com/swblockvolume-protection" }}")) &&
((has(object.metadata.finalizers) ? object.metadata.finalizers : []).filter(f, f == "{{ .Values.lifecycleOwner.finalizerName | default "block.seaweedfs.com/swblockvolume-protection" }}").size() <= 1)
)
message: lifecycle-owner may only add or remove the Seaweed Block protection finalizer
---
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingAdmissionPolicyBinding
metadata:
name: {{ include "seaweed-block.fullname" . }}-lifecycle-owner-finalizer-boundary
labels:
{{- include "seaweed-block.labels" . | nindent 4 }}
spec:
policyName: {{ include "seaweed-block.fullname" . }}-lifecycle-owner-finalizer-boundary
validationActions: ["Deny"]
{{- end }}
@@ -1,38 +0,0 @@
{{- if and .Values.lifecycleOwner.create .Values.lifecycleOwner.rbac.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "seaweed-block.fullname" . }}-lifecycle-owner
namespace: {{ .Release.Namespace }}
labels:
{{- include "seaweed-block.labels" . | nindent 4 }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "seaweed-block.fullname" . }}-lifecycle-owner
labels:
{{- include "seaweed-block.labels" . | nindent 4 }}
rules:
- apiGroups: ["block.seaweedfs.com"]
resources: ["swblockvolumes"]
verbs: ["get", "list", "watch", "patch"]
- apiGroups: [""]
resources: ["events"]
verbs: ["create"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "seaweed-block.fullname" . }}-lifecycle-owner
labels:
{{- include "seaweed-block.labels" . | nindent 4 }}
subjects:
- kind: ServiceAccount
name: {{ include "seaweed-block.fullname" . }}-lifecycle-owner
namespace: {{ .Release.Namespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ include "seaweed-block.fullname" . }}-lifecycle-owner
{{- end }}
@@ -1,39 +0,0 @@
{{- if .Values.lifecycleOwner.create }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: sw-block-lifecycle-owner
namespace: {{ .Release.Namespace }}
labels:
{{- include "seaweed-block.labels" . | nindent 4 }}
app: sw-block-lifecycle-owner
spec:
replicas: 1
selector:
matchLabels:
app: sw-block-lifecycle-owner
template:
metadata:
labels:
app: sw-block-lifecycle-owner
{{- include "seaweed-block.labels" . | nindent 8 }}
spec:
serviceAccountName: {{ include "seaweed-block.fullname" . }}-lifecycle-owner
{{- with .Values.lifecycleOwner.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: lifecycle-owner
image: {{ include "seaweed-block.image" . | quote }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["/usr/local/bin/sw-block"]
args:
- "ops"
- "lifecycle-owner"
{{- if .Values.lifecycleOwner.dryRun }}
- "--dry-run"
{{- end }}
- "--namespace={{ .Release.Namespace }}"
- "--interval={{ .Values.lifecycleOwner.interval }}"
{{- end }}
@@ -1,47 +0,0 @@
{{- if and .Values.operatorStatus.create .Values.operatorStatus.rbac.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "seaweed-block.fullname" . }}-operator-status
namespace: {{ .Release.Namespace }}
labels:
{{- include "seaweed-block.labels" . | nindent 4 }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "seaweed-block.fullname" . }}-operator-status
labels:
{{- include "seaweed-block.labels" . | nindent 4 }}
rules:
- apiGroups: [""]
resources: ["nodes", "pods"]
verbs: ["get", "list", "watch"]
- apiGroups: ["storage.k8s.io"]
resources: ["csidrivers", "csinodes"]
verbs: ["get", "list", "watch"]
- apiGroups: ["block.seaweedfs.com"]
resources: ["swblockclusters", "swblockvolumes"]
verbs: ["get", "list", "watch"]
- apiGroups: ["block.seaweedfs.com"]
resources: ["swblockclusters/status", "swblockvolumes/status"]
verbs: ["get", "update", "patch"]
- apiGroups: [""]
resources: ["events"]
verbs: ["create"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "seaweed-block.fullname" . }}-operator-status
labels:
{{- include "seaweed-block.labels" . | nindent 4 }}
subjects:
- kind: ServiceAccount
name: {{ include "seaweed-block.fullname" . }}-operator-status
namespace: {{ .Release.Namespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ include "seaweed-block.fullname" . }}-operator-status
{{- end }}
@@ -1,48 +0,0 @@
{{- if .Values.operatorStatus.create }}
{{- include "seaweed-block.readOnlyClientSecrets" . }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: sw-block-operator-status
namespace: {{ .Release.Namespace }}
labels:
{{- include "seaweed-block.labels" . | nindent 4 }}
app: sw-block-operator-status
spec:
replicas: 1
selector:
matchLabels:
app: sw-block-operator-status
template:
metadata:
labels:
app: sw-block-operator-status
{{- include "seaweed-block.labels" . | nindent 8 }}
spec:
serviceAccountName: {{ include "seaweed-block.fullname" . }}-operator-status
{{- with .Values.operatorStatus.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: operator-status
image: {{ include "seaweed-block.image" . | quote }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["/usr/local/bin/sw-block"]
args:
- "ops"
- "operator-status"
{{- if .Values.operatorStatus.dryRun }}
- "--dry-run"
{{- end }}
- "--master-api={{ include "seaweed-block.blockmasterAddress" . }}"
- "--namespace={{ .Release.Namespace }}"
- "--cluster-name={{ .Values.operatorStatus.clusterName }}"
- "--interval={{ .Values.operatorStatus.interval }}"
env:
{{- include "seaweed-block.masterTLSClientEnv" . | nindent 12 }}
volumeMounts:
{{- include "seaweed-block.masterTLSClientMount" . | nindent 12 }}
volumes:
{{- include "seaweed-block.masterTLSClientVolume" .Values.tls.clientSecrets.operatorStatus | nindent 8 }}
{{- end }}
@@ -1,83 +0,0 @@
{{- if .Values.rbac.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "seaweed-block.fullname" . }}-csi
namespace: {{ .Release.Namespace }}
labels:
{{- include "seaweed-block.labels" . | nindent 4 }}
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "seaweed-block.fullname" . }}-master
namespace: {{ .Release.Namespace }}
labels:
{{- include "seaweed-block.labels" . | nindent 4 }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "seaweed-block.fullname" . }}-master-launcher
labels:
{{- include "seaweed-block.labels" . | nindent 4 }}
rules:
- apiGroups: ["apps"]
resources: ["deployments"]
verbs: ["get", "list", "watch", "create", "delete", "update", "patch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "seaweed-block.fullname" . }}-master-launcher
labels:
{{- include "seaweed-block.labels" . | nindent 4 }}
subjects:
- kind: ServiceAccount
name: {{ include "seaweed-block.fullname" . }}-master
namespace: {{ .Release.Namespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ include "seaweed-block.fullname" . }}-master-launcher
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "seaweed-block.fullname" . }}-csi-controller
labels:
{{- include "seaweed-block.labels" . | nindent 4 }}
rules:
- apiGroups: [""]
resources: ["persistentvolumes", "persistentvolumeclaims", "nodes"]
verbs: ["get", "list", "watch", "create", "delete", "update", "patch"]
- apiGroups: [""]
resources: ["events"]
verbs: ["get", "list", "watch", "create", "update", "patch"]
- apiGroups: ["storage.k8s.io"]
resources: ["storageclasses", "volumeattachments", "volumeattachments/status", "csinodes", "csidrivers"]
verbs: ["get", "list", "watch", "create", "delete", "update", "patch"]
- apiGroups: ["coordination.k8s.io"]
resources: ["leases"]
verbs: ["get", "list", "watch", "create", "update", "patch"]
{{- if or .Values.operatorStatus.create .Values.lifecycleOwner.create }}
- apiGroups: ["block.seaweedfs.com"]
resources: ["swblockvolumes"]
verbs: ["get", "list", "watch", "create", "update", "patch"]
{{- end }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "seaweed-block.fullname" . }}-csi-controller
labels:
{{- include "seaweed-block.labels" . | nindent 4 }}
subjects:
- kind: ServiceAccount
name: {{ include "seaweed-block.fullname" . }}-csi
namespace: {{ .Release.Namespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ include "seaweed-block.fullname" . }}-csi-controller
{{- end }}
@@ -1,38 +0,0 @@
{{- if and .Values.rebuildTargetOwner.create .Values.rebuildTargetOwner.rbac.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "seaweed-block.fullname" . }}-rebuild-target-owner
namespace: {{ .Release.Namespace }}
labels:
{{- include "seaweed-block.labels" . | nindent 4 }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "seaweed-block.fullname" . }}-rebuild-target-owner
labels:
{{- include "seaweed-block.labels" . | nindent 4 }}
rules:
- apiGroups: ["block.seaweedfs.com"]
resources: ["swblockvolumes"]
verbs: ["get", "list", "watch"]
- apiGroups: ["block.seaweedfs.com"]
resources: ["swblockreplicarebuilds"]
verbs: ["get", "list", "watch", "create"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "seaweed-block.fullname" . }}-rebuild-target-owner
labels:
{{- include "seaweed-block.labels" . | nindent 4 }}
subjects:
- kind: ServiceAccount
name: {{ include "seaweed-block.fullname" . }}-rebuild-target-owner
namespace: {{ .Release.Namespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ include "seaweed-block.fullname" . }}-rebuild-target-owner
{{- end }}
@@ -1,39 +0,0 @@
{{- if .Values.rebuildTargetOwner.create }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: sw-block-rebuild-target-owner
namespace: {{ .Release.Namespace }}
labels:
{{- include "seaweed-block.labels" . | nindent 4 }}
app: sw-block-rebuild-target-owner
spec:
replicas: 1
selector:
matchLabels:
app: sw-block-rebuild-target-owner
template:
metadata:
labels:
app: sw-block-rebuild-target-owner
{{- include "seaweed-block.labels" . | nindent 8 }}
spec:
serviceAccountName: {{ include "seaweed-block.fullname" . }}-rebuild-target-owner
{{- with .Values.rebuildTargetOwner.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: rebuild-target-owner
image: {{ include "seaweed-block.image" . | quote }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["/usr/local/bin/sw-block"]
args:
- "ops"
- "rebuild-target-owner"
- "--namespace={{ .Release.Namespace }}"
{{- if .Values.rebuildTargetOwner.dryRun }}
- "--dry-run"
{{- end }}
- "--interval={{ .Values.rebuildTargetOwner.interval }}"
{{- end }}
@@ -1,28 +0,0 @@
{{- if .Values.storageClass.create }}
{{- if and (eq .Values.storageClass.nvmeTransport "rdma") (ne .Values.storageClass.protocol "nvme") }}
{{- fail "storageClass.nvmeTransport=rdma requires storageClass.protocol=nvme" }}
{{- end }}
{{- if and (eq .Values.storageClass.nvmeTransport "rdma") (not .Values.network.externalNVMe) }}
{{- fail "storageClass.nvmeTransport=rdma requires network.externalNVMe=true" }}
{{- end }}
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: {{ .Values.storageClass.name }}
labels:
{{- include "seaweed-block.labels" . | nindent 4 }}
provisioner: {{ .Values.driver.name }}
reclaimPolicy: {{ .Values.storageClass.reclaimPolicy }}
volumeBindingMode: {{ .Values.storageClass.volumeBindingMode }}
allowVolumeExpansion: {{ .Values.storageClass.allowVolumeExpansion }}
parameters:
replicationFactor: {{ .Values.storageClass.replicationFactor | quote }}
sw-block.seaweedfs.com/protocol: {{ .Values.storageClass.protocol | quote }}
{{- if eq .Values.storageClass.protocol "nvme" }}
sw-block.seaweedfs.com/nvme-transport: {{ .Values.storageClass.nvmeTransport | quote }}
{{- end }}
{{- if and .Values.chap.enabled .Values.storageClass.nodeStageSecret.enabled }}
csi.storage.k8s.io/node-stage-secret-name: {{ .Values.chap.secretName | quote }}
csi.storage.k8s.io/node-stage-secret-namespace: {{ .Values.appNamespace | quote }}
{{- end }}
{{- end }}
Loaded 100 of 3837 files, more files were not shown because too many files have changed in this diff. Show more