Skip to content

Implement Service Manager API to set replica mode (#52)#53

Merged
asfernandes merged 4 commits into
asfernandes:mainfrom
mariuz:main
Jun 5, 2026
Merged

Implement Service Manager API to set replica mode (#52)#53
asfernandes merged 4 commits into
asfernandes:mainfrom
mariuz:main

Conversation

@mariuz

@mariuz mariuz commented Jun 4, 2026

Copy link
Copy Markdown
Contributor
  1. Replication Mode Definitions:
    • Defined the ServiceManager.h enum class inside ServiceManager.h representing the three standard replication states: NONE , READ_ONLY , and READ_WRITE .
  2. Database Properties Support:
    • Added ConfigManager.h and ConfigManager.h classes to support modifying database properties using isc_action_svc_properties .
    • Implemented ConfigManager.cpp in ConfigManager.cpp to write the replica mode option ( isc_spb_prp_replica_mode ) to the service request parameter block.
    • Used insertBytes with a 1-byte value to correctly satisfy the clumplet size constraints of Firebird's replication properties API.
  3. Replication Mode During Database Restore:
    • Added getters, setters, and replicaMode field to BackupManager.h in BackupManager.h.
    • Updated database restoration logic in BackupManager.cpp to write isc_spb_res_replica_mode as a 1-byte value during database restore operations.
  4. Integration:
    • Included the new ConfigManager.h header in the main library header fb-cpp.h.
  5. Testing:
    • Wrote unit tests in ConfigManager.cpp verifying both replica mode configuration and database restoration replica states. The tests confirm the target mode by querying the MON$REPLICA_MODE table and system context variables.
    • Built and ran the test suite, with all 282 tests passing successfully.

Comment thread src/fb-cpp/ConfigManager.h Outdated
Comment thread src/fb-cpp/DatabaseManager.h Outdated
Comment thread src/fb-cpp/DatabaseManager.h Outdated
Comment thread src/fb-cpp/BackupManager.cpp
Comment thread src/fb-cpp/DatabaseManager.cpp
…ions, configure to execute, and add default assert(false) cases
@asfernandes asfernandes merged commit 8aed122 into asfernandes:main Jun 5, 2026
4 checks passed
@asfernandes asfernandes linked an issue Jun 5, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Service Manager API here to set the replica mode

2 participants