Commit Graph
3 Commits
Author SHA1 Message Date
Claude 723fc7cf76 Complete client library refactoring: fill all placeholders and implement missing functions
- Add REPLICATION_FACTOR and CHUNK_SIZE constants to config.h
- Add proper error codes (REJECTED, FULL, NOT_FOUND, TRANSFER_FAILED, etc.) to toastyfs.h
- Implement compute_chunk_hash() for deterministic chunk hashing
- Implement replay_request() to resend operations after leader redirect
- Implement send_message_to_server_ex() for sending messages with trailing data
- Implement choose_store_locations_for_chunk() to pick REPLICATION_FACTOR servers
- Fix begin_transfers() to handle both StoreChunk (PUT) and FetchChunk (GET)
- Complete toastyfs_async_put(): chunk splitting, hashing, data copy, metadata setup
- Complete toastyfs_async_get()/delete(): key setup, step/time initialization
- Fix get_result(): use actual transfer sizes instead of fixed chunk_size, free transfer data
- Replace all xxx placeholders and TOASTYFS_ERROR_XXX with proper values
- Add chunk_sizes[] tracking and put_data lifetime management
- Implement random_client.c: rng(), choose_random_oper(), proper API call arguments

https://claude.ai/code/session_01TkNavR4qyZcTuXMPmrtWUJ
2026-02-21 13:03:13 +00:00
Claude 78f2e5112b Apply code review feedback to client refactor
- Rename phase_time to step_time for consistency with Step enum
- Unify blob_size and file_size into single blob_size field
- Merge toastyfs_alloc into toastyfs_init, returning malloced ToastyFS*
- Replace (MessageHeader*)&msg casts with &msg.base
- Replace !resp.size with explicit resp.size == 0

https://claude.ai/code/session_018MRQTdAZoBCXJZgdP4U6V6
2026-02-21 11:54:21 +00:00
Claude 337cdad885 Fix test client refactor: broken includes, typos, and structural bugs
- Rename include/lib.h to include/toastyfs.h, add -Iinclude to build
- Fix build.sh: replace deleted blob_client.c with random_client.c
- Fix src/client.c: wrong include (client_lib.h), add missing STEP_FETCH_CHUNK
  enum, add missing struct fields (bucket, key, blob_size, content_hash,
  error, file_size, phase_time), fix TRANSFER_WAITING->TRANSFER_PENDING,
  fix begin_transfers() wrong variable refs, fix reap->resp typo,
  fix resp.size check inversion, fix state->tfs in process_events,
  fix tfs->transfer->tfs->transfers, fix tfs->phase->tfs->step,
  fix function name typos in toastyfs_get_result, fix async_put->async_get
  in toastyfs_get, fix ReplyMessage->RequestMessage in async_delete,
  fix put_result/delete_result return types, fix wait_until_result,
  add leader_idx() and toastyfs_alloc(), add missing MessageHeader casts
- Fix src/random_client.c: randm_client.h typo, addrs[i]->addrs[num_addrs],
  use toastyfs_alloc() for opaque type, fix tfs->state->tfs refs
- Fix src/random_client.h: wrong include guard names
- Fix src/main.c: replace deleted client.h/blob_client.h with
  random_client.h, update all client spawn configs to use RandomClient

https://claude.ai/code/session_018MRQTdAZoBCXJZgdP4U6V6
2026-02-21 11:46:01 +00:00